Exemplo n.º 1
0
        public override void Update()
        {
            if (_innerRigidBody != null && _shouldUpdate)
            {
                Collider  c = _geCollider;
                Transform t = gameElement.WorldTransform;
                // _innerRigidBody.MotionState.WorldTransform = (Matrix)t.GetTransformation();
                // .ActivationState == ActivationState.ActiveTag ? activeColor : passiveColor
                Matrix4f transform = _rbWorldTransfom;
                //gameElement.LocalTransform.Move(transform.GetTranslate());
                //gameElement.LocalTransform.Rotate(transform.GetEulerAngles());

                Vector3f
                    newT   = transform.GetTranslate(),
                    newR   = transform.GetEulerAngles(),
                    deltaT = newT - _lastTranslate,
                    deltaR = newR - _lastRotate;

                gameElement.LocalTransform.SetTranslation(newT);
                gameElement.LocalTransform.SetRotation(newR);

                _lastRotate    = newR;
                _lastTranslate = newT;

                _shouldUpdate = false;
            }
        }