mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-06-12 16:34:01 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
|
|
@ -19,13 +19,9 @@
|
|||
|
||||
class DynamicTexturedCubeDemo : public CommonExampleInterface
|
||||
{
|
||||
CommonGraphicsApp* m_app;
|
||||
float m_x;
|
||||
float m_y;
|
||||
float m_z;
|
||||
CommonGraphicsApp* m_app;
|
||||
b3AlignedObjectArray<int> m_movingInstances;
|
||||
|
||||
|
||||
|
||||
TinyVRGui* m_tinyVrGUI;
|
||||
|
||||
enum
|
||||
|
|
@ -33,120 +29,102 @@ class DynamicTexturedCubeDemo : public CommonExampleInterface
|
|||
numCubesX = 1,
|
||||
numCubesY = 1
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
DynamicTexturedCubeDemo(CommonGraphicsApp* app)
|
||||
:m_app(app),
|
||||
m_x(0),
|
||||
m_y(0),
|
||||
m_z(0),
|
||||
m_tinyVrGUI(0)
|
||||
{
|
||||
DynamicTexturedCubeDemo(CommonGraphicsApp* app)
|
||||
: m_app(app),
|
||||
m_tinyVrGUI(0)
|
||||
{
|
||||
m_app->setUpAxis(2);
|
||||
|
||||
{
|
||||
b3Vector3 extents=b3MakeVector3(100,100,100);
|
||||
extents[m_app->getUpAxis()]=1;
|
||||
|
||||
int xres = 20;
|
||||
int yres = 20;
|
||||
|
||||
b3Vector4 color0=b3MakeVector4(0.1, 0.1, 0.5,1);
|
||||
b3Vector4 color1=b3MakeVector4(0.6, 0.6, 0.6,1);
|
||||
m_app->registerGrid(xres, yres, color0, color1);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
b3Vector3 extents = b3MakeVector3(100, 100, 100);
|
||||
extents[m_app->getUpAxis()] = 1;
|
||||
|
||||
int xres = 20;
|
||||
int yres = 20;
|
||||
|
||||
b3Vector4 color0 = b3MakeVector4(0.1, 0.1, 0.5, 1);
|
||||
b3Vector4 color1 = b3MakeVector4(0.6, 0.6, 0.6, 1);
|
||||
m_app->registerGrid(xres, yres, color0, color1);
|
||||
}
|
||||
|
||||
ComboBoxParams comboParams;
|
||||
comboParams.m_comboboxId = 0;
|
||||
comboParams.m_numItems = 0;
|
||||
comboParams.m_startItem = 0;
|
||||
comboParams.m_callback = 0;//MyComboBoxCallback;
|
||||
comboParams.m_userPointer = 0;//this;
|
||||
|
||||
|
||||
m_tinyVrGUI = new TinyVRGui(comboParams,m_app->m_renderer);
|
||||
comboParams.m_comboboxId = 0;
|
||||
comboParams.m_numItems = 0;
|
||||
comboParams.m_startItem = 0;
|
||||
comboParams.m_callback = 0; //MyComboBoxCallback;
|
||||
comboParams.m_userPointer = 0; //this;
|
||||
|
||||
m_tinyVrGUI = new TinyVRGui(comboParams, m_app->m_renderer);
|
||||
m_tinyVrGUI->init();
|
||||
|
||||
m_app->m_renderer->writeTransforms();
|
||||
}
|
||||
virtual ~DynamicTexturedCubeDemo()
|
||||
{
|
||||
m_app->m_renderer->writeTransforms();
|
||||
}
|
||||
virtual ~DynamicTexturedCubeDemo()
|
||||
{
|
||||
delete m_tinyVrGUI;
|
||||
m_app->m_renderer->enableBlend(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual void physicsDebugDraw(int debugDrawMode)
|
||||
{
|
||||
|
||||
}
|
||||
virtual void initPhysics()
|
||||
{
|
||||
}
|
||||
virtual void exitPhysics()
|
||||
{
|
||||
|
||||
}
|
||||
virtual void physicsDebugDraw(int debugDrawMode)
|
||||
{
|
||||
}
|
||||
virtual void initPhysics()
|
||||
{
|
||||
}
|
||||
virtual void exitPhysics()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void stepSimulation(float deltaTime)
|
||||
{
|
||||
static b3Transform tr = b3Transform::getIdentity();
|
||||
virtual void stepSimulation(float deltaTime)
|
||||
{
|
||||
static b3Transform tr = b3Transform::getIdentity();
|
||||
static b3Scalar t = 0.f;
|
||||
t+=deltaTime;
|
||||
tr.setOrigin(b3MakeVector3(0.,0.,2.)+b3MakeVector3(0.,0.,0.02*b3Sin(t)));
|
||||
t += deltaTime;
|
||||
tr.setOrigin(b3MakeVector3(0., 0., 2.) + b3MakeVector3(0., 0., 0.02 * b3Sin(t)));
|
||||
|
||||
m_tinyVrGUI->tick(deltaTime,tr);
|
||||
m_tinyVrGUI->tick(deltaTime, tr);
|
||||
|
||||
m_app->m_renderer->writeTransforms();
|
||||
|
||||
}
|
||||
virtual void renderScene()
|
||||
{
|
||||
|
||||
m_app->m_renderer->writeTransforms();
|
||||
}
|
||||
virtual void renderScene()
|
||||
{
|
||||
m_app->m_renderer->renderScene();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void physicsDebugDraw()
|
||||
{
|
||||
}
|
||||
virtual bool mouseMoveCallback(float x, float y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool mouseButtonCallback(int button, int state, float x, float y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool keyboardCallback(int key, int state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
virtual void physicsDebugDraw()
|
||||
{
|
||||
|
||||
}
|
||||
virtual bool mouseMoveCallback(float x,float y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool mouseButtonCallback(int button, int state, float x, float y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool keyboardCallback(int key, int state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void resetCamera()
|
||||
{
|
||||
float dist = 1.15;
|
||||
float pitch = 396;
|
||||
float yaw = 33.7;
|
||||
float targetPos[3]={-0.5,0.7,1.45};
|
||||
if (m_app->m_renderer && m_app->m_renderer->getActiveCamera())
|
||||
float pitch = -33.7;
|
||||
float yaw = 396;
|
||||
float targetPos[3] = {-0.5, 0.7, 1.45};
|
||||
if (m_app->m_renderer && m_app->m_renderer->getActiveCamera())
|
||||
{
|
||||
m_app->m_renderer->getActiveCamera()->setCameraDistance(dist);
|
||||
m_app->m_renderer->getActiveCamera()->setCameraPitch(pitch);
|
||||
m_app->m_renderer->getActiveCamera()->setCameraYaw(yaw);
|
||||
m_app->m_renderer->getActiveCamera()->setCameraTargetPosition(targetPos[0],targetPos[1],targetPos[2]);
|
||||
m_app->m_renderer->getActiveCamera()->setCameraTargetPosition(targetPos[0], targetPos[1], targetPos[2]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
class CommonExampleInterface* DynamicTexturedCubeDemoCreateFunc(struct CommonExampleOptions& options)
|
||||
class CommonExampleInterface* DynamicTexturedCubeDemoCreateFunc(struct CommonExampleOptions& options)
|
||||
{
|
||||
return new DynamicTexturedCubeDemo(options.m_guiHelper->getAppInterface());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue