a) debug Camera Matrices. enable with _IRR_COMPILE_WITH_90_DEGREE_CAMERA.
- allow ICameraSceneNode to accept any values and correct in buildCameraLookAtMatrixLH with normalize_camera_direction. if disabled defaults to the current v1.9 normalize b) add initial Rotation to MayaCamera Constructor default 0,0 c) switchToMayaCamera in Examples. Clones FPSCamera default disabled git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6366 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -15,11 +15,13 @@ namespace scene
|
||||
|
||||
//! constructor
|
||||
CSceneNodeAnimatorCameraMaya::CSceneNodeAnimatorCameraMaya(gui::ICursorControl* cursor,
|
||||
f32 rotateSpeed, f32 zoomSpeed, f32 translateSpeed, f32 distance)
|
||||
f32 rotateSpeed, f32 zoomSpeed, f32 translateSpeed, f32 distance
|
||||
, f32 rotX, f32 rotY
|
||||
)
|
||||
: CursorControl(cursor), OldCamera(0), MousePos(0.5f, 0.5f),
|
||||
TargetMinDistance(0.f),
|
||||
ZoomSpeed(zoomSpeed), RotateSpeed(rotateSpeed), TranslateSpeed(translateSpeed),
|
||||
CurrentZoom(distance), RotX(0.0f), RotY(0.0f),
|
||||
CurrentZoom(distance), RotX(rotX), RotY(rotY),
|
||||
Zooming(false), Rotating(false), Moving(false), Translating(false)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
@@ -171,18 +173,18 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs)
|
||||
// Translation ---------------------------------
|
||||
|
||||
core::vector3df translate(OldTarget);
|
||||
const core::vector3df upVector(camera->getUpVector());
|
||||
const core::vector3df upVector(normalize_y(camera->getUpVector()));
|
||||
const core::vector3df target = camera->getTarget();
|
||||
|
||||
core::vector3df pos = camera->getPosition();
|
||||
core::vector3df tvectX = pos - target;
|
||||
tvectX = tvectX.crossProduct(upVector);
|
||||
tvectX.normalize();
|
||||
tvectX.normalize_z();
|
||||
|
||||
const SViewFrustum* const va = camera->getViewFrustum();
|
||||
core::vector3df tvectY = (va->getFarLeftDown() - va->getFarRightDown());
|
||||
tvectY = tvectY.crossProduct(upVector.Y > 0 ? pos - target : target - pos);
|
||||
tvectY.normalize();
|
||||
tvectY.normalize_x();
|
||||
|
||||
if (isMouseKeyDown(2) && !Zooming)
|
||||
{
|
||||
|
Reference in New Issue
Block a user