You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rotating still TBD.
To do this, 2 new 'types' had to be added to `MSG_SIM_MODIFY_ACTOR_REQUESTED`:
* SOFT_RESPAWN, //!< Like hard reset, but positions the actor like spawn process does - using the relative positions from rig-def file (respecting Tuning system tweaks).
* REFRESH_VISUALS //!< Forces a synchronous update of visuals from any context - i.e. from terrain editor mode or with sleeping/physicspaused actor.
Time spent: 90min
Copy file name to clipboardexpand all lines: source/main/physics/Actor.h
+5-3
Original file line number
Diff line number
Diff line change
@@ -98,8 +98,9 @@ class Actor : public RefCountingObject<Actor>
98
98
intgetShockNode1(int shock_number);
99
99
intgetShockNode2(int shock_number);
100
100
// not exported to scripting:
101
-
voidresetPosition(Ogre::Vector3 translation, bool setInitPosition); //!< Moves the actor to given world coords.
102
-
voidresetPosition(float px, float pz, bool setInitPosition, float miny); //!< Moves the actor to given world coords.
101
+
voidresetPosition(Ogre::Vector3 translation, bool setInitPosition); //!< Moves the actor to given world coords (pivot point is node 0).
102
+
voidresetPosition(float px, float pz, bool setInitPosition, float miny); //!< Moves the actor to given world coords (pivot point is node 0).
103
+
voidsoftRespawn(Ogre::Vector3 spawnpos); //!< Use `MSG_SIM_MODIFY_ACTOR_REQUESTED` with type `SOFT_RESPAWN`; Resets the actor to given position as if spawned there (pivot point is `spawnpos`).
@@ -281,6 +282,7 @@ class Actor : public RefCountingObject<Actor>
281
282
int* ar_nodes_id = nullptr; //!< Number in truck file, -1 for nodes generated by wheels/cinecam
282
283
std::string* ar_nodes_name = nullptr; //!< Name in truck file, only if defined with 'nodes2'
283
284
int ar_nodes_name_top_length = 0; //!< For nicely formatted diagnostic output
285
+
Ogre::Vector3* ar_nodes_spawn_offsets = nullptr; //!< Relative positions (incl. Tuning system tweaks) from the definition file, for spawn-like resetting (i.e. with terrain editor on preloaded actor).
284
286
int ar_num_nodes = 0;
285
287
std::vector<float> ar_minimass; //!< minimum node mass in Kg
286
288
bool ar_minimass_skip_loaded_nodes = false;
@@ -308,7 +310,7 @@ class Actor : public RefCountingObject<Actor>
Copy file name to clipboardexpand all lines: source/main/physics/SimData.h
+3
Original file line number
Diff line number
Diff line change
@@ -860,9 +860,11 @@ struct ActorModifyRequest
860
860
RELOAD, //!< Full reload from filesystem, requested by user
861
861
RESET_ON_INIT_POS,
862
862
RESET_ON_SPOT,
863
+
SOFT_RESPAWN, //!< Like hard reset, but positions the actor like spawn process does - using the relative positions from rig-def file (respecting Tuning system tweaks).
863
864
SOFT_RESET,
864
865
RESTORE_SAVED,
865
866
WAKE_UP,
867
+
REFRESH_VISUALS //!< Forces a synchronous update of visuals from any context - i.e. from terrain editor mode or with sleeping/physicspaused actor.
866
868
};
867
869
868
870
ActorInstanceID_t amr_actor = ACTORINSTANCEID_INVALID;// not ActorPtr because it's not thread-safe
@@ -871,6 +873,7 @@ struct ActorModifyRequest
871
873
amr_saved_state;
872
874
CacheEntryPtr amr_addonpart; //!< Primary method of specifying cache entry.
873
875
std::string amr_addonpart_fname; //!< Fallback method in case CacheEntry doesn't exist anymore - that means mod was uninstalled in the meantime. Used by REMOVE_ADDONPART_AND_RELOAD.
876
+
Ogre::Vector3 amr_softrespawn_pos; //!< Position to use with `SOFT_RESPAWN`.
0 commit comments