|
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
70 Ogre::Vector3 translation = Ogre::Vector3::ZERO;
71 float rotation = 0.0f;
75 translation += 2.0f * Ogre::Vector3::UNIT_Y * dt;
79 translation -= 2.0f * Ogre::Vector3::UNIT_Y * dt;
83 rotation += 0.5f * dt;
87 rotation -= 0.5f * dt;
92 translation.x += 2.0f * cos(curRot - Ogre::Math::HALF_PI) * dt;
93 translation.z += 2.0f * sin(curRot - Ogre::Math::HALF_PI) * dt;
98 translation.x -= 2.0f * cos(curRot - Ogre::Math::HALF_PI) * dt;
99 translation.z -= 2.0f * sin(curRot - Ogre::Math::HALF_PI) * dt;
104 translation.x += 2.0f * cos(curRot) * dt;
105 translation.z += 2.0f * sin(curRot) * dt;
110 translation.x -= 2.0f * cos(curRot) * dt;
111 translation.z -= 2.0f * sin(curRot) * dt;
114 if (translation != Ogre::Vector3::ZERO || rotation != 0.0f)
122 rotation *= Ogre::Math::Clamp(scale, 0.1f, 10.0f);
123 translation *= scale;
132 actor->requestRotation(rotation, rotation_center);
133 actor->requestTranslation(translation);
146 actor->requestAngleSnap(45);
Game state manager and message-queue provider.
@ MSG_SIM_MODIFY_ACTOR_REQUESTED
Payload = RoR::ActorModifyRequest* (owner)
CVar * sim_soft_reset_mode
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
CVar * sim_live_repair_interval
Hold EV_COMMON_REPAIR_TRUCK to enter LiveRepair mode. 0 or negative interval disables.
void requestAngleSnap(int division)
ActorInstanceID_t amr_actor
enum Script2Game::inputEvents KC_LSHIFT
bool m_quick_repair_active
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
void requestRotation(float rotation, Ogre::Vector3 center)
enum Script2Game::inputEvents KC_SPACE
GameContext * GetGameContext()
Unified game event system - all requests and state changes are reported using a message.
float m_live_repair_timer
Ogre::Vector3 getRotationCenter()
void requestTranslation(Ogre::Vector3 translation)
InputEngine * GetInputEngine()
Actor feat - interactive recovery and repair mode.
void UpdateInputEvents(float dt)
@ NETWORKED_OK
not simulated (remote) actor
const ActorPtr & GetPlayerActor()
bool m_live_repair_active