Exemplo n.º 1
0
Vector3 Box::GetNormalLocalInertialTensor() const
{
	// TODO: is this correct? I am not sure what the 'Normal' Inertial Tensor is
	// interial matrix for box is
	//				 | (y^2 + z^2)      0           0      |
	//	I = (M/12) * |      0      (x^2 + z^2)      0      |
	//				 |      0           0      (x^2 + y^2) |
	Vector3 size = 2*GetHalfSize();
	float x2 = size.x * size.x;
	float y2 = size.y * size.y;
	float z2 = size.z * size.z;
	return (GetNormalMass()/12.0) * Vector3((y2+z2), (x2+z2), (x2+y2));
}
Exemplo n.º 2
0
float RigidBody::GetMass() const
{
	return HasInfiniteMass() ? inf : GetNormalMass();
}
Exemplo n.º 3
0
Vector3 Sphere::GetNormalLocalInertialTensor() const
{
	return Vector3::UNIT_SCALE * (0.4f * GetNormalMass() * GetRadius() * GetRadius());
}