Quantcast
Channel: Intel® Developer Zone - Havok
Viewing all articles
Browse latest Browse all 168

Havok and OpenGL scaling

$
0
0

I've successfully integrated Havok Physics into my OpenGL Game Engine(Programmable Pipeline), but the collision seems off. My Cube's points are defined at +-0.5 in opengl space. The rigid-body i attach to it needs a size value of 0.45 to look accurate in my engine.

	hkpBoxShape* box = new hkpBoxShape(hkVector4(0.45f, 0.45f, 0.45f, 0.0f));
	// convex radius for spheres is exactly the sphere radius
	hkpRigidBodyCinfo rigidBodyInfo;
	rigidBodyInfo.m_shape = box;
	rigidBodyInfo.m_motionType = hkpMotion::MOTION_DYNAMIC;
	hkpInertiaTensorComputer::setShapeVolumeMassProperties(box, 1.0f, rigidBodyInfo);
	rigidBodyInfo.m_position.set(0.0f, 0.0f, 0.0f);
	rigidBodyInfo.m_friction = 1.0f;
	rigidBodyInfo.m_restitution = 0.2f;
	mRigidbody = new hkpRigidBody(rigidBodyInfo);
	box->removeReference();

 


Viewing all articles
Browse latest Browse all 168

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>