Game Development Reference
In-Depth Information
// Player Update
// Player's Weapon
ProcessCollisions();
if (m_CameraMoved)
{
ProcessCameraMove();
}
m_Camera.UpdateCamera();
////////////////////////// Update Object Physics
// Cube1
m_Cube.UpdateObject3d();
// Cube2
m_Cube2.UpdateObject3d();
// Process Collisions
Physics.CollisionStatus TypeCollision = m_Cube.GetObjectPhysics().CheckForCollisionSpher
eBounding(m_Cube, m_Cube2);
if ((TypeCollision == Physics.CollisionStatus.COLLISION) ||
(TypeCollision == Physics.CollisionStatus.PENETRATING_COLLISION))
{
m_Cube.GetObjectPhysics().ApplyLinearImpulse(m_Cube, m_Cube2);
// SFX
m_Cube.PlaySound(m_SoundIndex1);
m_Cube2.PlaySound(m_SoundIndex2);
}
//////////////////////////// Draw Objects
m_Cube.DrawObject(m_Camera, m_PointLight);
m_Cube2.DrawObject(m_Camera, m_PointLight);
////////////////////////// Update and Draw Grid
UpdateGravityGrid();
m_Grid.DrawGrid(m_Camera);
// Player's Pyramid
m_Pyramid.UpdateObject3d();
m_Pyramid.DrawObject(m_Camera, m_PointLight);
// Did user touch screen
if (m_ScreenTouched)
{
// Process Screen Touch
CheckTouch();
m_ScreenTouched = false;
}
m_Weapon.UpdateWeapon();
m_Weapon.RenderWeapon(m_Camera, m_PointLight, false);
Search WWH ::




Custom Search