more example refactoring
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
#include "ExampleInterface.h"
|
||||
#include "CommonGUIHelperInterface.h"
|
||||
#include "CommonRenderInterface.h"
|
||||
#include "CommonCameraInterface.h"
|
||||
|
||||
#include "CommonGraphicsAppInterface.h"
|
||||
#include "CommonWindowInterface.h"
|
||||
|
||||
@@ -169,8 +171,9 @@ struct CommonRigidBodyBase : public ExampleInterface
|
||||
float fov = btScalar(2.0) * btAtan(tanFov);
|
||||
|
||||
btVector3 camPos,camTarget;
|
||||
renderer->getCameraPosition(camPos);
|
||||
renderer->getCameraTargetPosition(camTarget);
|
||||
|
||||
renderer->getActiveCamera()->getCameraPosition(camPos);
|
||||
renderer->getActiveCamera()->getCameraTargetPosition(camTarget);
|
||||
|
||||
btVector3 rayFrom = camPos;
|
||||
btVector3 rayForward = (camTarget-camPos);
|
||||
@@ -228,7 +231,7 @@ struct CommonRigidBodyBase : public ExampleInterface
|
||||
|
||||
btVector3 rayTo = getRayTo(int(x), int(y));
|
||||
btVector3 rayFrom;
|
||||
renderer->getCameraPosition(rayFrom);
|
||||
renderer->getActiveCamera()->getCameraPosition(rayFrom);
|
||||
movePickedBody(rayFrom,rayTo);
|
||||
|
||||
return false;
|
||||
@@ -252,7 +255,7 @@ struct CommonRigidBodyBase : public ExampleInterface
|
||||
if(button==0 && (!window->isModifiedKeyPressed(B3G_ALT) && !window->isModifiedKeyPressed(B3G_CONTROL) ))
|
||||
{
|
||||
btVector3 camPos;
|
||||
renderer->getCameraPosition(camPos);
|
||||
renderer->getActiveCamera()->getCameraPosition(camPos);
|
||||
|
||||
btVector3 rayFrom = camPos;
|
||||
btVector3 rayTo = getRayTo(int(x),int(y));
|
||||
|
||||
Reference in New Issue
Block a user