43 btRigidBody* Transform::parentsBody()
const {
51 return parent_as_game_object->bulletProperties.
rigidBody();
64 return parent_as_game_object->parentScene();
70 if(parent() && parent()->parent()) {
82 if(parent() && parent()->parent()) {
94 if(parent() && parent()->parent()) {
106 if (!parentsBody()) {
108 return unit_type ==
WORLD ? origin : origin * k_QGLGameEditorViewport_SizeFactor;
112 parentsBody()->getMotionState()->getWorldTransform(t);
116 unit_type ==
WORLD ? t.getOrigin() / k_QGLGameEditorViewport_SizeFactor : t.getOrigin()
118 return transform.getOrigin();
125 return btVector3(scale[0][0],
133 if (!parentsBody()) {
138 parentsBody()->getMotionState()->getWorldTransform(t);
141 transform.setRotation(t.getRotation());
142 return transform.getRotation();
148 if (!parentsBody()) {
153 btTransform t = parentsBody()->getWorldTransform();
154 t.setOrigin(p * k_QGLGameEditorViewport_SizeFactor);
156 parentsBody()->setWorldTransform(t);
159 parentsBody()->setCenterOfMassTransform(t);
160 parentsBody()->getMotionState()->setWorldTransform(t);
173 scale->setValue(s.x(), 0, 0,
193 if (!parentsBody()) {
199 parentsBody()->getMotionState()->getWorldTransform(t);
203 parentsBody()->setWorldTransform(t);
204 parentsBody()->getMotionState()->setWorldTransform(t);
261 btVector3 new_position =
localPosition() + (forward_vec * dz);
268 if (transform_mode ==
LOCAL) {
278 btQuaternion x_rot(btVector3(1.0f, 0, 0),
DEGTORAD(angle));
279 rotate(x_rot, transform_mode);
285 btQuaternion y_rot(btVector3(0, 1.0f, 0),
DEGTORAD(angle));
286 if (transform_mode ==
LOCAL) {
296 btQuaternion z_rot(btVector3(0, 0, 1.0f), angle);
297 rotate(z_rot, transform_mode);
303 btMatrix3x3 scale_transform;
307 scale_transform = m_localTransform.
getScale();
310 if (!parentsBody()) {
311 return m_localTransform;
315 m_localTransform.
scale(scale_transform);
317 return m_localTransform;
323 if(parent() && parent()->parent()) {
btVector3 getAxisZ(btMatrix3x3 &m)
btVector3 getAxisY(btMatrix3x3 &m)
btRigidBody * rigidBody() const
btVector3 getAxisX(btMatrix3x3 &m)