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:
@@ -50,6 +50,42 @@ namespace irr
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
For using an alternative camera in the examples.
|
||||
Try to translate the viewpoint (Maya internal CameraRotation)
|
||||
*/
|
||||
static inline void switchToMayaCamera(IrrlichtDevice* device)
|
||||
{
|
||||
#if 1
|
||||
return;
|
||||
#else
|
||||
if (!device) return;
|
||||
|
||||
scene::ICameraSceneNode* camera = device->getSceneManager()->getActiveCamera();
|
||||
if (!camera || camera->getID() == 54321) return;
|
||||
|
||||
|
||||
core::vector3df target = camera->getTarget() - camera->getPosition();
|
||||
core::vector3df relativeRotation = target.getHorizontalAngle();
|
||||
|
||||
scene::ICameraSceneNode* maya = device->getSceneManager()->addCameraSceneNodeMaya(
|
||||
0, -1500, 1000, 1500,
|
||||
54321,
|
||||
target.getLength(),
|
||||
true,
|
||||
relativeRotation.X + 90, relativeRotation.Y
|
||||
);
|
||||
if (maya)
|
||||
{
|
||||
maya->setNearValue(camera->getNearValue());
|
||||
maya->setFarValue(camera->getFarValue());
|
||||
}
|
||||
|
||||
device->getCursorControl()->setVisible(true);
|
||||
device->setResizable(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user