Builds and manages softbody actors (physics on background thread, networking)
More...
#include <ActorManager.h>
|
| ActorManager () |
|
| ~ActorManager () |
|
void | UpdateActors (ActorPtr player_actor) |
|
void | SyncWithSimThread () |
|
void | UpdatePhysicsSimulation () |
|
void | WakeUpAllActors () |
|
void | SendAllActorsSleeping () |
|
unsigned long | GetNetTime () |
|
int | GetNetTimeOffset (int sourceid) |
|
void | UpdateNetTimeOffset (int sourceid, int offset) |
|
void | AddStreamMismatch (int sourceid, int streamid) |
|
int | CheckNetworkStreamsOk (int sourceid) |
|
int | CheckNetRemoteStreamsOk (int sourceid) |
|
void | MuteAllActors () |
|
void | UnmuteAllActors () |
|
void | SetTrucksForcedAwake (bool forced) |
|
bool | AreTrucksForcedAwake () const |
|
void | SetSimulationSpeed (float speed) |
|
float | GetSimulationSpeed () const |
|
bool | IsSimulationPaused () const |
|
void | SetSimulationPaused (bool v) |
|
float | GetTotalTime () const |
|
RoR::CmdKeyInertiaConfig & | GetInertiaConfig () |
|
void | CleanUpSimulation () |
| Call this after simulation loop finishes. More...
|
|
void | RepairActor (Collisions *collisions, const Ogre::String &inst, const Ogre::String &box, bool keepPosition=false) |
|
void | UpdateSleepingState (ActorPtr player_actor, float dt) |
|
void | UpdateInputEvents (float dt) |
|
RigDef::DocumentPtr | FetchActorDef (RoR::ActorSpawnRequest &rq) |
|
void | HandleActorStreamData (std::vector< RoR::NetRecvPacket > packet) |
|
bool | LoadScene (Ogre::String filename) |
|
bool | SaveScene (Ogre::String filename) |
|
void | RestoreSavedState (ActorPtr actor, rapidjson::Value const &j_entry) |
|
ActorPtrVec & | GetActors () |
|
std::vector< ActorPtr > | GetLocalActors () |
|
std::pair< ActorPtr, float > | GetNearestActor (Ogre::Vector3 position) |
|
bool | AreActorsDirectlyLinked (const ActorPtr &a1, const ActorPtr &a2) |
|
|
ActorPtr | CreateNewActor (ActorSpawnRequest rq, RigDef::DocumentPtr def) |
|
void | DeleteActorInternal (ActorPtr actor) |
| Do not call directly; use GameContext::DeleteActor() More...
|
|
|
const ActorPtr & | GetActorById (ActorInstanceID_t actor_id) |
|
const ActorPtr & | GetActorByNetworkLinks (int source_id, int stream_id) |
|
ActorPtr | FindActorInsideBox (Collisions *collisions, const Ogre::String &inst, const Ogre::String &box) |
|
const ActorPtr & | FetchNextVehicleOnList (ActorPtr player, ActorPtr prev_player) |
|
const ActorPtr & | FetchPreviousVehicleOnList (ActorPtr player, ActorPtr prev_player) |
|
const ActorPtr & | FetchRescueVehicle () |
|
|
void | AddFreeForce (FreeForceRequest *rq) |
|
void | ModifyFreeForce (FreeForceRequest *rq) |
|
void | RemoveFreeForce (FreeForceID_t id) |
|
FreeForceVec_t::iterator | FindFreeForce (FreeForceID_t id) |
|
FreeForceID_t | GetFreeForceNextId () |
|
Builds and manages softbody actors (physics on background thread, networking)
Definition at line 43 of file ActorManager.h.
◆ FreeForceVec_t
◆ ActorManager()
ActorManager::ActorManager |
( |
| ) |
|
◆ ~ActorManager()
ActorManager::~ActorManager |
( |
| ) |
|
◆ AddFreeForce()
◆ AddStreamMismatch()
void RoR::ActorManager::AddStreamMismatch |
( |
int |
sourceid, |
|
|
int |
streamid |
|
) |
| |
|
inline |
◆ AreActorsDirectlyLinked()
bool ActorManager::AreActorsDirectlyLinked |
( |
const ActorPtr & |
a1, |
|
|
const ActorPtr & |
a2 |
|
) |
| |
◆ AreTrucksForcedAwake()
bool RoR::ActorManager::AreTrucksForcedAwake |
( |
| ) |
const |
|
inline |
◆ CalcFreeForces()
void ActorManager::CalcFreeForces |
( |
| ) |
|
|
private |
Apply FreeForces - intentionally as a separate pass over all actors.
Definition at line 1494 of file ActorManager.cpp.
◆ CheckActorCollAabbIntersect()
bool ActorManager::CheckActorCollAabbIntersect |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
|
private |
Returns whether or not the bounding boxes of truck a and truck b intersect. Based on the truck collision bounding boxes.
Definition at line 566 of file ActorManager.cpp.
◆ CheckNetRemoteStreamsOk()
int ActorManager::CheckNetRemoteStreamsOk |
( |
int |
sourceid | ) |
|
◆ CheckNetworkStreamsOk()
int ActorManager::CheckNetworkStreamsOk |
( |
int |
sourceid | ) |
|
◆ CleanUpSimulation()
void ActorManager::CleanUpSimulation |
( |
| ) |
|
◆ CreateNewActor()
◆ DeleteActorInternal()
void ActorManager::DeleteActorInternal |
( |
ActorPtr |
actor | ) |
|
◆ FetchActorDef()
◆ FetchNextVehicleOnList()
◆ FetchPreviousVehicleOnList()
◆ FetchRescueVehicle()
const ActorPtr & ActorManager::FetchRescueVehicle |
( |
| ) |
|
◆ FindActorInsideBox()
ActorPtr ActorManager::FindActorInsideBox |
( |
Collisions * |
collisions, |
|
|
const Ogre::String & |
inst, |
|
|
const Ogre::String & |
box |
|
) |
| |
◆ FindFreeForce()
ActorManager::FreeForceVec_t::iterator ActorManager::FindFreeForce |
( |
FreeForceID_t |
id | ) |
|
◆ ForwardCommands()
void ActorManager::ForwardCommands |
( |
ActorPtr |
source_actor | ) |
|
|
private |
◆ GetActorById()
◆ GetActorByNetworkLinks()
const ActorPtr & ActorManager::GetActorByNetworkLinks |
( |
int |
source_id, |
|
|
int |
stream_id |
|
) |
| |
◆ GetActors()
◆ GetFreeForceNextId()
◆ GetInertiaConfig()
◆ GetLocalActors()
std::vector< ActorPtr > ActorManager::GetLocalActors |
( |
| ) |
|
◆ GetNearestActor()
std::pair< ActorPtr, float > ActorManager::GetNearestActor |
( |
Ogre::Vector3 |
position | ) |
|
◆ GetNetTime()
unsigned long RoR::ActorManager::GetNetTime |
( |
| ) |
|
|
inline |
◆ GetNetTimeOffset()
int ActorManager::GetNetTimeOffset |
( |
int |
sourceid | ) |
|
◆ GetSimulationSpeed()
float RoR::ActorManager::GetSimulationSpeed |
( |
| ) |
const |
|
inline |
◆ GetTotalTime()
float RoR::ActorManager::GetTotalTime |
( |
| ) |
const |
|
inline |
◆ HandleActorStreamData()
◆ IsSimulationPaused()
bool RoR::ActorManager::IsSimulationPaused |
( |
| ) |
const |
|
inline |
◆ LoadScene()
bool ActorManager::LoadScene |
( |
Ogre::String |
filename | ) |
|
◆ ModifyFreeForce()
◆ MuteAllActors()
void ActorManager::MuteAllActors |
( |
| ) |
|
◆ PredictActorCollAabbIntersect()
bool ActorManager::PredictActorCollAabbIntersect |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
|
private |
Returns whether or not the bounding boxes of truck a and truck b might intersect during the next framestep. Based on the truck collision bounding boxes.
Definition at line 595 of file ActorManager.cpp.
◆ RecursiveActivation()
void ActorManager::RecursiveActivation |
( |
int |
j, |
|
|
std::vector< bool > & |
visited |
|
) |
| |
|
private |
◆ RemoveFreeForce()
◆ RemoveStreamSource()
void ActorManager::RemoveStreamSource |
( |
int |
sourceid | ) |
|
|
private |
◆ RepairActor()
void ActorManager::RepairActor |
( |
Collisions * |
collisions, |
|
|
const Ogre::String & |
inst, |
|
|
const Ogre::String & |
box, |
|
|
bool |
keepPosition = false |
|
) |
| |
◆ RestoreSavedState()
void ActorManager::RestoreSavedState |
( |
ActorPtr |
actor, |
|
|
rapidjson::Value const & |
j_entry |
|
) |
| |
◆ SaveScene()
bool ActorManager::SaveScene |
( |
Ogre::String |
filename | ) |
|
◆ SendAllActorsSleeping()
void ActorManager::SendAllActorsSleeping |
( |
| ) |
|
◆ SetSimulationPaused()
void RoR::ActorManager::SetSimulationPaused |
( |
bool |
v | ) |
|
|
inline |
◆ SetSimulationSpeed()
void RoR::ActorManager::SetSimulationSpeed |
( |
float |
speed | ) |
|
|
inline |
◆ SetTrucksForcedAwake()
void RoR::ActorManager::SetTrucksForcedAwake |
( |
bool |
forced | ) |
|
|
inline |
◆ SyncWithSimThread()
void ActorManager::SyncWithSimThread |
( |
| ) |
|
◆ UnmuteAllActors()
void ActorManager::UnmuteAllActors |
( |
| ) |
|
◆ UpdateActors()
void ActorManager::UpdateActors |
( |
ActorPtr |
player_actor | ) |
|
◆ UpdateInputEvents()
void ActorManager::UpdateInputEvents |
( |
float |
dt | ) |
|
◆ UpdateNetTimeOffset()
void ActorManager::UpdateNetTimeOffset |
( |
int |
sourceid, |
|
|
int |
offset |
|
) |
| |
◆ UpdatePhysicsSimulation()
void ActorManager::UpdatePhysicsSimulation |
( |
| ) |
|
◆ UpdateSleepingState()
void ActorManager::UpdateSleepingState |
( |
ActorPtr |
player_actor, |
|
|
float |
dt |
|
) |
| |
◆ UpdateTruckFeatures()
void ActorManager::UpdateTruckFeatures |
( |
ActorPtr |
vehicle, |
|
|
float |
dt |
|
) |
| |
|
private |
◆ WakeUpAllActors()
void ActorManager::WakeUpAllActors |
( |
| ) |
|
◆ ACTORPTR_NULL
const ActorPtr ActorManager::ACTORPTR_NULL |
|
static |
◆ inter_actor_links
◆ m_actors
◆ m_dt_remainder
float RoR::ActorManager::m_dt_remainder = 0.f |
|
private |
Keeps track of the rounding error in the time step calculation.
Definition at line 148 of file ActorManager.h.
◆ m_forced_awake
bool RoR::ActorManager::m_forced_awake = false |
|
private |
◆ m_free_force_next_id
◆ m_free_forces
Global forces added ad-hoc by scripts.
Definition at line 154 of file ActorManager.h.
◆ m_inertia_config
◆ m_last_simulation_speed
float RoR::ActorManager::m_last_simulation_speed = 0.1f |
|
private |
previously used time ratio between real time (evt.timeSinceLastFrame) and physics time ('dt' used in calcPhysics)
Definition at line 150 of file ActorManager.h.
◆ m_net_timer
Ogre::Timer RoR::ActorManager::m_net_timer |
|
private |
◆ m_physics_steps
int RoR::ActorManager::m_physics_steps = 0 |
|
private |
◆ m_sim_task
std::shared_ptr<Task> RoR::ActorManager::m_sim_task |
|
private |
◆ m_sim_thread_pool
std::unique_ptr<ThreadPool> RoR::ActorManager::m_sim_thread_pool |
|
private |
◆ m_simulation_paused
bool RoR::ActorManager::m_simulation_paused = false |
|
private |
◆ m_simulation_speed
float RoR::ActorManager::m_simulation_speed = 1.f |
|
private |
◆ m_simulation_time
float RoR::ActorManager::m_simulation_time = 0.f |
|
private |
Amount of time the physics simulation is going to be advanced.
Definition at line 151 of file ActorManager.h.
◆ m_stream_mismatches
std::map<int, std::set<int> > RoR::ActorManager::m_stream_mismatches |
|
private |
Networking: A set of streams without a corresponding actor in the actor-array for each stream source.
Definition at line 140 of file ActorManager.h.
◆ m_stream_time_offsets
std::map<int, int> RoR::ActorManager::m_stream_time_offsets |
|
private |
Networking: A network time offset for each stream source.
Definition at line 141 of file ActorManager.h.
◆ m_total_sim_time
float RoR::ActorManager::m_total_sim_time = 0.f |
|
private |
The documentation for this class was generated from the following files: