Item Class Reference#include <item.h>
Inheritance diagram for Item:
[legend]
|
Public Types |
enum | LightType {
NoLight = 0,
ConstantLight,
PulsingLight,
NumLightTypes
} |
enum | MaskBits {
HiddenMask = Parent::NextFreeMask,
ThrowSrcMask = Parent::NextFreeMask << 1,
PositionMask = Parent::NextFreeMask << 2,
RotationMask = Parent::NextFreeMask << 3,
NextFreeMask = Parent::NextFreeMask << 4
} |
Public Member Functions |
void | registerLights (LightManager *lightManager, bool lightingScene) |
| Traverses mounted objects and registers light sources with the light manager.
|
| DECLARE_CONOBJECT (Item) |
| Item () |
| ~Item () |
bool | onAdd () |
| Called when the object is added to the sim.
|
void | onRemove () |
| Called when the object is removed from the sim.
|
bool | onNewDataBlock (GameBaseData *dptr) |
| Called when a new datablock is set.
|
bool | isStatic () |
bool | isRotating () |
Point3F | getVelocity () const |
| Gets the velocity of the object.
|
void | setVelocity (const VectorF &vel) |
| Sets the velocity of this object.
|
void | applyImpulse (const Point3F &pos, const VectorF &vec) |
| Applies an impulse force to this object.
|
void | setCollisionTimeout (ShapeBase *obj) |
ShapeBase * | getCollisionObject () |
void | processTick (const Move *move) |
| Processes a move event and updates object state once every 32 milliseconds.
|
void | interpolateTick (F32 delta) |
| Interpolates between tick events.
|
void | setTransform (const MatrixF &mat) |
| Sets the Object -> World transform.
|
void | renderImage (SceneState *state, SceneRenderImage *image) |
U32 | packUpdate (NetConnection *conn, U32 mask, BitStream *stream) |
| Instructs this object to pack its state for transfer over the network.
|
void | unpackUpdate (NetConnection *conn, BitStream *stream) |
| Instructs this object to read state data previously packed with packUpdate.
|
Static Public Member Functions |
static void | initPersistFields () |
| Register dynamic fields in a subclass of ConsoleObject.
|
static void | consoleInit () |
| Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.
|
Data Fields |
Point3F | mStickyCollisionPos |
Point3F | mStickyCollisionNormal |
Private Types |
typedef ShapeBase | Parent |
Private Member Functions |
void | updateVelocity (const F32 dt) |
void | updatePos (const U32 mask, const F32 dt) |
void | updateWorkingCollisionSet (const U32 mask, const F32 dt) |
bool | buildPolyList (AbstractPolyList *polyList, const Box3F &box, const SphereF &sphere) |
| Builds a polylist of the polygons in this object returns true if successful.
|
void | buildConvex (const Box3F &box, Convex *convex) |
| Builds a convex hull for this object.
|
void | onDeleteNotify (SimObject *) |
| Called when a SimObject is deleted.
|
bool | prepRenderImage (SceneState *state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState) |
| Called when the SceneGraph is ready for the registration of RenderImages.
|
Private Attributes |
StateDelta | delta |
ItemData * | mDataBlock |
| Datablock.
|
bool | mCollidable |
bool | mStatic |
bool | mRotate |
VectorF | mVelocity |
bool | mAtRest |
S32 | mAtRestCounter |
bool | mInLiquid |
ShapeBase * | mCollisionObject |
U32 | mCollisionTimeout |
S32 | mDropTime |
LightInfo | mLight |
OrthoBoxConvex | mConvex |
Box3F | mWorkingQueryBox |
Static Private Attributes |
static F32 | mGravity |
static const S32 | csmAtRestTimer |
Data Structures |
struct | StateDelta |
| Client interpolation data. More...
|
Member Typedef Documentation
Member Enumeration Documentation
- Enumerator:
-
NoLight |
|
ConstantLight |
|
PulsingLight |
|
NumLightTypes |
|
- Enumerator:
-
HiddenMask |
|
ThrowSrcMask |
|
PositionMask |
|
RotationMask |
|
NextFreeMask |
|
Constructor & Destructor Documentation
Member Function Documentation
void Item::registerLights |
( |
LightManager * |
lightManager, |
|
|
bool |
lightingScene | |
|
) |
| | [virtual] |
Traverses mounted objects and registers light sources with the light manager.
- Parameters:
-
| lightManager | Light manager to register with |
| lightingScene | Set to true if the scene is being lit, in which case these lights will not be used |
Reimplemented from ShapeBase.
void Item::updateVelocity |
( |
const F32 |
dt |
) |
[private] |
void Item::updatePos |
( |
const U32 |
mask, |
|
|
const F32 |
dt | |
|
) |
| | [private] |
void Item::updateWorkingCollisionSet |
( |
const U32 |
mask, |
|
|
const F32 |
dt | |
|
) |
| | [private] |
Builds a polylist of the polygons in this object returns true if successful.
- Parameters:
-
| polyList | Returned polylist (out) |
| box | Not used |
| sphere | Not used |
Reimplemented from ShapeBase.
void Item::buildConvex |
( |
const Box3F & |
box, |
|
|
Convex * |
convex | |
|
) |
| | [private, virtual] |
Builds a convex hull for this object.
- See also:
- Convex
- Parameters:
-
| box | Bounding box |
| convex | New convex hull (out) |
Reimplemented from ShapeBase.
void Item::onDeleteNotify |
( |
SimObject * |
object |
) |
[private, virtual] |
Called when a SimObject is deleted.
When you are on the notification list for another object and it is deleted, this method is called.
Reimplemented from ShapeBase.
bool Item::prepRenderImage |
( |
SceneState * |
state, |
|
|
const U32 |
stateKey, |
|
|
const U32 |
startZone, |
|
|
const bool |
modifyBaseZoneState | |
|
) |
| | [private, virtual] |
Called when the SceneGraph is ready for the registration of RenderImages.
- See also:
- SceneState
- Parameters:
-
| state | SceneState |
| stateKey | State key of the current SceneState |
| startZone | Base zone index |
| modifyBaseZoneState | If true, the object needs to modify the zone state. |
Reimplemented from ShapeBase.
Item::DECLARE_CONOBJECT |
( |
Item |
|
) |
|
static void Item::initPersistFields |
( |
|
) |
[static] |
static void Item::consoleInit |
( |
|
) |
[static] |
Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.
- Deprecated:
- You should use ConsoleMethod and ConsoleFunction, not this, to register methods or commands.
- See also:
- console
Reimplemented from ShapeBase.
bool Item::onAdd |
( |
|
) |
[virtual] |
Called when the object is added to the sim.
Reimplemented from ShapeBase.
void Item::onRemove |
( |
|
) |
[virtual] |
Called when the object is removed from the sim.
Reimplemented from ShapeBase.
Called when a new datablock is set.
This allows subclasses to appropriately handle new datablocks.
- See also:
- setDataBlock()
- Parameters:
-
Reimplemented from ShapeBase.
bool Item::isStatic |
( |
|
) |
[inline] |
bool Item::isRotating |
( |
|
) |
[inline] |
Point3F Item::getVelocity |
( |
|
) |
const [virtual] |
Gets the velocity of the object.
Reimplemented from SceneObject.
void Item::setVelocity |
( |
const VectorF & |
vel |
) |
[virtual] |
Sets the velocity of this object.
- Parameters:
-
Reimplemented from ShapeBase.
Applies an impulse force to this object.
- Parameters:
-
| pos | Position where impulse came from in world space |
| vec | Velocity vector (Impulse force F = m * v) |
Reimplemented from ShapeBase.
ShapeBase* Item::getCollisionObject |
( |
|
) |
[inline] |
void Item::processTick |
( |
const Move * |
move |
) |
[virtual] |
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).
- See also:
- ProcessList
- Parameters:
-
| move | Move event corresponding to this tick, or NULL. |
Reimplemented from ShapeBase.
void Item::interpolateTick |
( |
F32 |
delta |
) |
[virtual] |
Interpolates between tick events.
This takes place on the CLIENT ONLY.
- Parameters:
-
| delta | Time since last call to interpolate |
Reimplemented from GameBase.
void Item::setTransform |
( |
const MatrixF & |
mat |
) |
[virtual] |
Sets the Object -> World transform.
- Parameters:
-
Reimplemented from SceneObject.
Instructs this object to pack its state for transfer over the network.
- Parameters:
-
| conn | Net connection being used |
| mask | Mask indicating fields to transmit. |
| stream | Bitstream to pack data to |
- Returns:
- Any bits which were not dealt with. The value is stored by the networking system. Don't set bits you weren't passed.
Reimplemented from ShapeBase.
Instructs this object to read state data previously packed with packUpdate.
- Parameters:
-
| conn | Net connection being used |
| stream | stream to read from |
Reimplemented from ShapeBase.
Field Documentation
|