Math::Matrix4 VisualActor::getModelMatrix(const Math::Vector3d& position, float direction) { Math::Matrix4 posMatrix; posMatrix.setPosition(position); Math::Matrix4 rot1; rot1.buildAroundX(90); Math::Matrix4 rot2; rot2.buildAroundY(270 - direction); Math::Matrix4 scale; scale.setValue(2, 2, -1.0f); return posMatrix * rot1 * rot2 * scale; }
Math::Matrix4 VisualProp::getModelMatrix(const Math::Vector3d& position, float direction) { Math::Matrix4 posMatrix; posMatrix.setPosition(position); Math::Matrix4 rot1; rot1.buildAroundX(90); Math::Matrix4 rot2; rot2.buildAroundY(270 - direction); Math::Matrix4 scale; scale.setValue(2, 2, -1.0f); Math::Matrix4 modelTransform = _model->getTransform(); // FIXME: Why has the scale to be after the model transform? return posMatrix * rot1 * rot2 * modelTransform * scale; }