Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SM_MotionState.h « include « Fuzzics « Sumo « Physics « gameengine « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9c6a9ddaec22e06cf01a91eebc145deec17fe94b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef SM_MOTIONSTATE_H
#define SM_MOTIONSTATE_H

#include "MT_Transform.h"

class SM_MotionState {
public:
	SM_MotionState() :
		m_pos(0.0, 0.0, 0.0),
		m_orn(0.0, 0.0, 0.0, 1.0),
		m_lin_vel(0.0, 0.0, 0.0),
		m_ang_vel(0.0, 0.0, 0.0)
		{}

	void setPosition(const MT_Point3& pos)             { m_pos = pos; }
	void setOrientation(const MT_Quaternion& orn)      { m_orn = orn; }
    void setLinearVelocity(const MT_Vector3& lin_vel)  { m_lin_vel = lin_vel; }
	void setAngularVelocity(const MT_Vector3& ang_vel) { m_ang_vel = ang_vel; }

	const MT_Point3&     getPosition()        const { return m_pos; }
	const MT_Quaternion& getOrientation()     const { return m_orn; }
    const MT_Vector3&    getLinearVelocity()  const { return m_lin_vel; }
    const MT_Vector3&    getAngularVelocity() const { return m_ang_vel;	}

	virtual MT_Transform getTransform() const {
		return MT_Transform(m_pos, m_orn);
	}

protected:
	MT_Point3         m_pos;
	MT_Quaternion     m_orn;
	MT_Vector3        m_lin_vel;
	MT_Vector3        m_ang_vel;
};
	
#endif