// Converts world HL units to HL local/object units
void CPhysicsObject::WorldToLocal( Vector &localPosition, const Vector &worldPosition )
{
	matrix3x4_t matrix;
	GetPositionMatrix( matrix );
	// copy in case the src == dest
	VectorITransform( Vector(worldPosition), matrix, localPosition );
}
void CPhysicsObject::WorldToLocalVector( Vector &localVector, const Vector &worldVector )
{
	matrix3x4_t matrix;
	GetPositionMatrix( matrix );
	// copy in case the src == dest
	VectorIRotate( Vector(worldVector), matrix, localVector );
}
Пример #3
0
void CPhysicsObject::WorldToLocalVector(Vector *localVector, const Vector &worldVector) const {
	if (!localVector) return;

	matrix3x4_t matrix;
	GetPositionMatrix(&matrix);
	VectorIRotate(worldVector, matrix, *localVector);
}
Пример #4
0
void CPhysicsObject::LocalToWorldVector(Vector *worldVector, const Vector &localVector) const {
	if (!worldVector) return;

	matrix3x4_t matrix;
	GetPositionMatrix(&matrix);
	VectorRotate(localVector, matrix, *worldVector);
}
Пример #5
0
void CPhysicsObject::WorldToLocal(Vector *localPosition, const Vector &worldPosition) const {
	if (!localPosition) return;

	matrix3x4_t matrix;
	GetPositionMatrix(&matrix);
	VectorITransform(worldPosition, matrix, *localPosition);
}
Пример #6
0
void CPhysicsObject::LocalToWorld(Vector *worldPosition, const Vector &localPosition) const {
	if (!worldPosition) return;

	matrix3x4_t matrix;
	GetPositionMatrix(&matrix);
	VectorTransform(localPosition, matrix, *worldPosition);
}
Пример #7
0
 void TextWidget::UpdateAndRender(int elapsed, SORE_Graphics::ImmediateModeProvider& imm_mode)
 {
     unsigned int h = static_cast<unsigned int>(GetSize(VERTICAL));
     imm_mode.SetMaterial(material);
     imm_mode.SetTransform(SORE_Graphics::MatrixPtr(new SORE_Math::Matrix4<float>(GetPositionMatrix())));
     imm_mode.SetColor(color);
     imm_mode.DrawString(0.0f, 0.0f, 0.0f, face, h, text);
 }