This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ShutdownVDB() { | |
g_pVdb->removeReference(); | |
g_pContext->removeReference(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hkMemoryRouter* memoryRouter = hkMemoryInitUtil::initDefault( hkMallocAllocator::m_defaultMallocAllocator, hkMemorySystem::FrameInfo( 500* 1024 ) ); | |
hkBaseSystem::init( memoryRouter, OnError ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GL/freeglut.h> | |
#include <iostream> | |
//Havok headers | |
// Keycode | |
#include <Common/Base/keycode.cxx> | |
#include <Common/Base/Config/hkProductFeatures.cxx> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void InitializeHavok() { | |
InitMemory(); | |
InitPhysicalWorld(); | |
if (g_bVdbEnabled) | |
InitVDB(); | |
//new additions in SimpleBox | |
g_pWorld->lock(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void AddRigidBodies() { | |
//add the falling box | |
{ | |
hkVector4 halfExtents(0.5f, 0.5f, 0.5f); | |
hkpBoxShape* boxShape = new hkpBoxShape(halfExtents); | |
hkpRigidBodyCinfo ci; | |
ci.m_shape = boxShape; | |
ci.m_position = hkVector4(0, 10, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hkVector4 halfExtents(0.5f, 0.5f, 0.5f); | |
hkpBoxShape* boxShape = new hkpBoxShape(halfExtents); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hkpRigidBodyCinfo ci; | |
ci.m_shape = boxShape; | |
ci.m_position = hkVector4(0, 10, 0); | |
ci.m_motionType = hkpMotion::MOTION_DYNAMIC; | |
boxShape->setRadius(0.001f); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hkReal boxMass(10.0f); | |
hkMassProperties massProps; | |
hkpInertiaTensorComputer::computeShapeVolumeMassProperties(boxShape, boxMass, massProps); | |
ci.setMassProperties(massProps); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hkpRigidBody* rigidBody = new hkpRigidBody(ci); | |
boxShape->removeReference(); | |
box = static_cast<hkpRigidBody*>(g_pWorld->addEntity(rigidBody)); | |
rigidBody->removeReference(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g_pWorld->markForRead(); | |
{ | |
//code for reading of rigid bodies and their properties | |
} | |
g_pWorld->unmarkForRead(); |