![]() TGE Version 1.5.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GameBase Class Reference#include <gameBase.h>
Inheritance diagram for GameBase: ![]() Detailed DescriptionBase class for game objects which use datablocks, networking, are editable, and need to process ticks.
GameBase and ProcessListGameBase adds two kinds of time-based updates. Torque works off of a concept of ticks. Ticks are slices of time 32 milliseconds in length. There are three methods which are used to update GameBase objects that are registered with the ProcessLists:
Torque maintains a server and a client processing list; in a local game, both are populated, while in multiplayer situations, either one or the other is populated. You can control whether an object is considered for ticking by means of the setProcessTick() method. GameBase and DatablocksGameBase adds support for datablocks. Datablocks are secondary classes which store static data for types of game elements. For instance, this means that all "light human male armor" type Players share the same datablock. Datablocks typically store not only raw data, but perform precalculations, like finding nodes in the game model, or validating movement parameters.There are three parts to the datablock interface implemented in GameBase:
Datablocks are also usable through the scripting language.
GameBase and NetworkingwritePacketData() and readPacketData() are called to transfer information needed for client side prediction. They are usually used when updating a client of its control object state.Subclasses of GameBase usually transmit positional and basic status data in the packUpdate() functions, while giving velocity, momentum, and similar state information in the writePacketData(). writePacketData()/readPacketData() are called in addition to packUpdate/unpackUpdate().
Member Typedef Documentation
Reimplemented from SceneObject. Reimplemented in AIPlayer, AIWheeledVehicle, Camera, Debris, FireballAtmosphere, Explosion, fxLight, Lightning, ParticleEmitterNode, ParticleEmitter, Precipitation, Splash, WeatherLightning, Item, MissionMarker, SpawnSphere, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, PathedInterior, sgLightObject, sgMissionLightingFilter, and volumeLight.
Member Enumeration Documentation
Constructor & Destructor Documentation
Member Function Documentation
Called when the object is added to the sim.
Reimplemented from SceneObject. Reimplemented in Camera, Debris, FireballAtmosphere, Explosion, fxLight, Lightning, ParticleEmitterNode, ParticleEmitter, Precipitation, Splash, WeatherLightning, Item, MissionMarker, SpawnSphere, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, PathedInterior, sgLightObject, sgMissionLightingFilter, and volumeLight.
Called when the object is removed from the sim.
Reimplemented from SceneObject. Reimplemented in Camera, Debris, FireballAtmosphere, Explosion, fxLight, Lightning, ParticleEmitterNode, ParticleEmitter, Precipitation, Splash, WeatherLightning, Item, MissionMarker, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, PathedInterior, sgMissionLightingFilter, and volumeLight.
Called after any property of the object is changed in the world editor.
Reimplemented from SceneObject. Reimplemented in fxLight, Precipitation, MissionMarker, SpawnSphere, StaticShape, sgLightObject, sgMissionLightingFilter, and volumeLight.
Register dynamic fields in a subclass of ConsoleObject.
Reimplemented from SceneObject. Reimplemented in Camera, Debris, FireballAtmosphere, Explosion, fxLight, Lightning, ParticleEmitterNode, Precipitation, WeatherLightning, Item, MissionMarker, SpawnSphere, PathCamera, Projectile, RigidShape, StaticShape, Trigger, FlyingVehicle, Vehicle, WheeledVehicle, PathedInterior, sgLightObject, sgMissionLightingFilter, and volumeLight.
Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.
Reimplemented from ConsoleObject. Reimplemented in Camera, Item, PathCamera, Player, ShapeBase, and volumeLight.
Assigns this object a datablock and loads attributes with onNewDataBlock.
Called when a new datablock is set. This allows subclasses to appropriately handle new datablocks.
Reimplemented in Debris, FireballAtmosphere, Explosion, fxLight, Lightning, ParticleEmitterNode, ParticleEmitter, Precipitation, Splash, WeatherLightning, Item, MissionMarker, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, PathedInterior, sgLightObject, and sgMissionLightingFilter.
Executes the 'onAdd' script function for this object.
Executes the 'onNewDataBlock' script function for this object.
Executes the 'onRemove' script function for this object.
Set the status of tick processing. If this is set to true, processTick will be called; if false, then it will be skipped.
Force this object to process after some other object. For example, a player mounted to a vehicle would want to process after the vehicle, to prevent a visible "lagging" from occuring when the vehicle motions, so the player would be set to processAfter(theVehicle);
Clears the effects of a call to processAfter().
Removes this object from the tick-processing list.
Processes a move event and updates object state once every 32 milliseconds. This takes place both on the client and server, every 32 milliseconds (1 tick).
Reimplemented in Camera, Debris, Explosion, fxLight, Lightning, ParticleEmitter, Precipitation, Splash, WeatherLightning, Item, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, Vehicle, WheeledVehicle, PathedInterior, and sgLightObject. Interpolates between tick events. This takes place on the CLIENT ONLY.
Reimplemented in Camera, Lightning, Precipitation, Item, PathCamera, Player, Projectile, RigidShape, StaticShape, and Vehicle. Advances simulation time for animations. This is called every frame.
Reimplemented in Debris, FireballAtmosphere, Explosion, Lightning, ParticleEmitterNode, ParticleEmitter, Splash, WeatherLightning, Player, Projectile, RigidShape, ShapeBase, FlyingVehicle, HoverVehicle, Vehicle, and WheeledVehicle. This is a component system thing, gotta ask Clark about it.
Draws a bounding box around this object.
This returns a value which is used to prioritize which objects need to be updated. In NetObject, our returned priority is 0.1 * updateSkips, so that less recently updated objects are more likely to be updated. In subclasses, this can be adjusted. For instance, ShapeBase provides priority based on proximity to the camera.
Reimplemented from NetObject. Reimplemented in Projectile, and ShapeBase.
Instructs this object to pack its state for transfer over the network.
Reimplemented from NetObject. Reimplemented in Camera, FireballAtmosphere, fxLight, Lightning, ParticleEmitterNode, Precipitation, Splash, WeatherLightning, Item, MissionMarker, SpawnSphere, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, PathedInterior, sgLightObject, sgMissionLightingFilter, and volumeLight.
Instructs this object to read state data previously packed with packUpdate.
Reimplemented from NetObject. Reimplemented in Camera, FireballAtmosphere, fxLight, Lightning, ParticleEmitterNode, Precipitation, Splash, WeatherLightning, Item, MissionMarker, SpawnSphere, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, PathedInterior, sgLightObject, sgMissionLightingFilter, and volumeLight.
Write state information necessary to perform client side prediction of an object. This information is sent only to the controling object. For example, if you are a client controlling a Player, the server uses writePacketData() instead of packUpdate() to generate the data you receive.
Reimplemented in Camera, Player, RigidShape, ShapeBase, FlyingVehicle, Vehicle, and WheeledVehicle.
Read data written with writePacketData() and update the object state.
Reimplemented in Camera, Player, RigidShape, ShapeBase, FlyingVehicle, Vehicle, and WheeledVehicle.
Gets the checksum for packet data. Basically writes a packet, does a CRC check on it, and returns that CRC.
Reimplemented in ShapeBase.
Returns the client controling this object.
Sets the client controling this object.
Reimplemented in Player.
Friends And Related Function Documentation
Reimplemented from NetObject.
Field Documentation
Reimplemented in Debris, FireballAtmosphere, Explosion, fxLight, Lightning, ParticleEmitterNode, ParticleEmitter, Precipitation, Splash, WeatherLightning, Item, MissionMarker, PathCamera, Player, Projectile, RigidShape, ShapeBase, StaticShape, Trigger, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, PathedInterior, sgLightObject, and sgMissionLightingFilter.
Tag used to sort objects for processing.
Ordered process queue link.
Should we render bounding boxes?
Reimplemented in ShapeBase.
|