This is an object class that provides additional support for the camera, such as looking at a specific target or rotating around that target object.
More...
#include <Camera/C3rdCamera.h>
|
| void | updateInputRotate (float timeDiff) |
| | Internal helper to process rotation input.
|
|
void | setOwner (CGameObject *obj) |
|
|
CCamera * | m_camera |
| | Pointer to the CCamera component.
|
|
CEntity * | m_followEntity |
| | The entity being followed.
|
|
core::vector3df | m_followPosition |
| | The position being followed (if m_isFollowPosition is true).
|
|
core::vector3df | m_targetOffset |
| | Offset from the follow target.
|
|
bool | m_isFollowPosition |
| | Whether to follow a static position or an entity.
|
|
float | m_minVerticalAngle |
| | Minimum vertical tilt angle.
|
|
float | m_maxVerticalAngle |
| | Maximum vertical tilt angle.
|
|
float | m_camPan |
| | Horizontal rotation angle (0-360).
|
|
float | m_camTilt |
| | Vertical rotation angle (-89 to +89).
|
|
float | m_targetDistance |
| | Distance from the target.
|
|
int | m_touchId |
| | Tracking touch ID for rotation.
|
|
core::position2df | m_centerCursor |
| | Normalized cursor position at start of drag.
|
|
core::position2df | m_cursorPos |
| | Current normalized cursor position.
|
|
bool | m_leftMousePress |
| | Whether the primary mouse button is pressed.
|
|
float | m_rotateSpeed |
| | Rotation sensitivity.
|
|
CGameObject * | m_gameObject |
|
bool | m_enable |
|
bool | m_serializable |
|
std::vector< CComponentSystem * > | m_linkComponent |
|
|
static int | useComponent (CComponentSystem *used) |
This is an object class that provides additional support for the camera, such as looking at a specific target or rotating around that target object.
The 3rd person camera support touch screen gestures or mouse dragging to rotate around the target. You can call the function CCamera::setInputReceiver(false) to disable this feature.
Example of setting up a follow camera
CGameObject* camera3rdTopObj = zone->createEmptyObject();
C3rdCamera* followTopCam = camera3rdTopObj->addComponent<C3rdCamera>();
void setTargetOffset(const core::vector3df &offset)
Sets an offset from the follow target (e.g., to frame the character).
Definition C3rdCamera.h:276
void setFollowTarget(CGameObject *object)
Sets a GameObject as the orbit target.
Definition C3rdCamera.h:166
void setOrientation(float pan, float tilt, float distance)
Configures initial orbit orientation and distance.
Definition C3rdCamera.h:188
void setTargetDistance(float d)
Sets the distance from the target.
Definition C3rdCamera.h:240
This is an object class used to set up the camera, including its position, viewing angle,...
Definition CCamera.h:70
void lookAt(const core::vector3df &position, const core::vector3df &target, const core::vector3df &up)
Configures the camera to look at a target from a specific position.
void setInputReceiver(bool b)
Enables or disables input reception for this camera.
Definition CCamera.h:406
void setPosition(const core::vector3df &position)
Sets the world position of the camera.
This object class stores information for a GameObject.
Definition CGameObject.h:52
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition vector3d.h:445
- See also
- CCamera
◆ getCamera()
| CCamera * Skylicht::C3rdCamera::getCamera |
( |
| ) |
|
|
inline |
Gets the attached camera component.
- Returns
- Pointer to CCamera.
◆ getCameraPan()
| float Skylicht::C3rdCamera::getCameraPan |
( |
| ) |
|
|
inline |
Gets the current horizontal rotation.
- Returns
- Pan angle.
◆ getCameraTilt()
| float Skylicht::C3rdCamera::getCameraTilt |
( |
| ) |
|
|
inline |
Gets the current vertical rotation.
- Returns
- Tilt angle.
◆ getFollowPosition()
Gets the static orbit position.
- Returns
- Position vector.
◆ getMaxVerticalAngle()
| float Skylicht::C3rdCamera::getMaxVerticalAngle |
( |
| ) |
|
|
inline |
Gets the maximum vertical tilt angle.
- Returns
- Angle in degrees.
◆ getMinVerticalAngle()
| float Skylicht::C3rdCamera::getMinVerticalAngle |
( |
| ) |
|
|
inline |
Gets the minimum vertical tilt angle.
- Returns
- Angle in degrees.
◆ getTargetDistance()
| float Skylicht::C3rdCamera::getTargetDistance |
( |
| ) |
|
|
inline |
Gets the current distance from the target.
- Returns
- Distance.
◆ getTargetOffset()
Gets the target offset.
- Returns
- Offset vector.
◆ initComponent()
| virtual void Skylicht::C3rdCamera::initComponent |
( |
| ) |
|
|
virtual |
◆ lateUpdate()
| virtual void Skylicht::C3rdCamera::lateUpdate |
( |
| ) |
|
|
virtual |
◆ OnEvent()
| virtual bool Skylicht::C3rdCamera::OnEvent |
( |
const SEvent & | event | ) |
|
|
virtual |
Called if an event happened.
Please take care that you should only return 'true' when you want to prevent Irrlicht from processing the event any further. So 'true' does mean that an event is completely done. Therefore your return value for all unprocessed events should be 'false'.
- Returns
- True if the event was processed.
Implements irr::IEventReceiver.
◆ setFollowPosition()
| void Skylicht::C3rdCamera::setFollowPosition |
( |
const core::vector3df & | pos | ) |
|
|
inline |
Sets a static world position for the camera to orbit.
- Parameters
-
◆ setFollowTarget() [1/2]
| void Skylicht::C3rdCamera::setFollowTarget |
( |
CEntity * | entity | ) |
|
|
inline |
Sets an entity as the orbit target.
- Parameters
-
| entity | Pointer to target entity. |
◆ setFollowTarget() [2/2]
| void Skylicht::C3rdCamera::setFollowTarget |
( |
CGameObject * | object | ) |
|
|
inline |
Sets a GameObject as the orbit target.
- Parameters
-
| object | Pointer to target object. |
◆ setMinMaxVerticaAngle()
| void Skylicht::C3rdCamera::setMinMaxVerticaAngle |
( |
float | min, |
|
|
float | max ) |
|
inline |
Sets vertical rotation limits.
- Parameters
-
| min | Min tilt angle. |
| max | Max tilt angle. |
◆ setOrientation() [1/2]
| void Skylicht::C3rdCamera::setOrientation |
( |
float | pan, |
|
|
float | tilt ) |
|
inline |
Configures initial orbit orientation.
- Parameters
-
| pan | Horizontal angle. |
| tilt | Vertical angle. |
◆ setOrientation() [2/2]
| void Skylicht::C3rdCamera::setOrientation |
( |
float | pan, |
|
|
float | tilt, |
|
|
float | distance ) |
|
inline |
Configures initial orbit orientation and distance.
- Parameters
-
| pan | Horizontal angle. |
| tilt | Vertical angle. |
| distance | Distance from target. |
◆ setTargetDistance()
| void Skylicht::C3rdCamera::setTargetDistance |
( |
float | d | ) |
|
|
inline |
Sets the distance from the target.
- Parameters
-
◆ setTargetOffset()
| void Skylicht::C3rdCamera::setTargetOffset |
( |
const core::vector3df & | offset | ) |
|
|
inline |
Sets an offset from the follow target (e.g., to frame the character).
- Parameters
-
◆ updateComponent()
| virtual void Skylicht::C3rdCamera::updateComponent |
( |
| ) |
|
|
virtual |
◆ updateInputRotate()
| void Skylicht::C3rdCamera::updateInputRotate |
( |
float | timeDiff | ) |
|
|
protected |
Internal helper to process rotation input.
- Parameters
-
The documentation for this class was generated from the following file: