Component

Engine/source/T3D/components/component.h

More...

Description

enum
NetMaskBits {
  InitialUpdateMask = BIT(0)
  OwnerMask = BIT(1)
  UpdateMask = BIT(2)
  EnableMask = BIT(3)
  NextFreeMask = BIT(4)
}

@Primary usage functions @These are used by the various engine-based behaviors to integrate with the component classes

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Instructs this object to pack its state for transfer over the network.

Instructs this object to read state data previously packed with packUpdate.

bool
setDescription(void * object, const char * index, const char * data)
const char *
getDescription(void * obj, const char * data)

Adding Named Fields

addComponentField(const char * fieldName, const char * desc, const char * type, const char * defaultValue, const char * userData, bool hidden)

Adds a named field to a Component that can specify a description, data type, default value and userData.

Returns the number of ComponentField's on this template.

Gets a ComponentField by its index in the mFields vector.

const char *
const char *
bool
beginFieldGroup(const char * groupName)

Private Types

Parent 

Public Attributes

Public Functions

checkComponentFieldModified(const char * slotName, const char * newValue)

This is what we actually use to check if the modified field is one of our behavior fields. If it is, we update and make the correct callbacks.

bool
bool
bool

Called when the object is added to the sim.

onDynamicModified(const char * slotName, const char * newValue)

Called when a dynamic field is modified.

Called when the object is removed from the sim.

onStaticModified(const char * slotName, const char * newValue)

Called when a static field is modified.

packToStream(Stream & stream, U32 tabStop, S32 behaviorID, U32 flags)
setDataField(StringTableEntry slotName, const char * array, const char * value)
setEnabled(bool toggle)
setOwner(Entity * pOwner)

Public Static Functions

bool
_setEnabled(void * object, const char * index, const char * data)
bool
setOwner(void * object, const char * index, const char * data)

Detailed Description

Description

NetMaskBits

Enumerator

InitialUpdateMask = BIT(0)
OwnerMask = BIT(1)
UpdateMask = BIT(2)
EnableMask = BIT(3)
NextFreeMask = BIT(4)

@Primary usage functions @These are used by the various engine-based behaviors to integrate with the component classes

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Reimplemented from: NetObject

Reimplemented by: AnimationComponent, CameraComponent, CameraOrbiterComponent, CollisionComponent, StateMachineComponent, TriggerComponent, PhysicsComponent, PlayerControllerComponent, RigidBodyComponent, MeshComponent

unpackUpdate(NetConnection * conn, BitStream * stream)

Reimplemented from: NetObject

Reimplemented by: AnimationComponent, CameraComponent, CameraOrbiterComponent, CollisionComponent, StateMachineComponent, TriggerComponent, PhysicsComponent, PlayerControllerComponent, RigidBodyComponent, MeshComponent

setDescription(void * object, const char * index, const char * data)

getDescription(void * obj, const char * data)

Adding Named Fields

addComponentField(const char * fieldName, const char * desc, const char * type, const char * defaultValue, const char * userData, bool hidden)

Adds a named field to a Component that can specify a description, data type, default value and userData.

Parameters:

fieldName

The name of the Field

desc

The Description of the Field

type

The Type of field that this is, example 'Text' or 'Bool'

defaultValue

The Default value of this field

userData

An extra optional field that can be used for user data

getComponentFieldCount()

Returns the number of ComponentField's on this template.

getComponentField(S32 idx)

Gets a ComponentField by its index in the mFields vector.

Parameters:

idx

The index of the field in the mField vector

getComponentField(const char * fieldName)

getComponentType()

getDescriptionText(const char * desc)

getName()

getFriendlyName()

isNetworked()

beginFieldGroup(const char * groupName)

endFieldGroup()

addDependency(StringTableEntry name)

Private Types

typedef NetObject Parent 

Protected Attributes

U32 componentIdx 
StringTableEntry mComponentGroup 
StringTableEntry mComponentType 
Vector< StringTableEntry > mDependencies 
StringTableEntry mDescription 
bool mEnabled 
Vector< ComponentField > mFields 
StringTableEntry mFriendlyName 
StringTableEntry mFromResource 
bool mHidden 
bool mNetworked 
StringTableEntry mNetworkType 
Entity * mOwner 
StringTableEntry mTemplateName 

Public Attributes

Signal< void(SimObject *, String, String) > onDataSet 

Public Functions

Component()

~Component()

advanceTime(F32 dt)

Reimplemented from: UpdateInterface

Reimplemented by: AnimationComponent

checkComponentFieldModified(const char * slotName, const char * newValue)

This is what we actually use to check if the modified field is one of our behavior fields. If it is, we update and make the correct callbacks.

checkDependencies()

Reimplemented by: CollisionComponent

componentAddedToOwner(Component * comp)

Reimplemented by: AnimationComponent, CameraOrbiterComponent, CollisionComponent, TriggerComponent, PlayerControllerComponent, RigidBodyComponent

componentRemovedFromOwner(Component * comp)

Reimplemented by: AnimationComponent, CameraOrbiterComponent, CollisionComponent, TriggerComponent, PlayerControllerComponent, RigidBodyComponent

DECLARE_CONOBJECT(Component )

getOwner()

interpolateTick(F32 dt)

Reimplemented from: UpdateInterface

Reimplemented by: PhysicsComponent, PlayerControllerComponent

isActive()

isEnabled()

onAdd()

Reimplemented from: NetObject

Reimplemented by: AnimationComponent, CameraComponent, CameraOrbiterComponent, StateMachineComponent, TriggerComponent, PlayerControllerComponent, RigidBodyComponent, MeshComponent

onComponentAdd()

Reimplemented by: AnimationComponent, CameraOrbiterComponent, CollisionComponent, StateMachineComponent, TriggerComponent, PhysicsComponent, PlayerControllerComponent, RigidBodyComponent, MeshComponent

onComponentRemove()

Reimplemented by: CameraOrbiterComponent, CollisionComponent, StateMachineComponent, TriggerComponent, RigidBodyComponent, MeshComponent

onDynamicModified(const char * slotName, const char * newValue)

Reimplemented from: SimObject

Reimplemented by: StateMachineComponent, MeshComponent

onRemove()

Reimplemented from: NetObject

Reimplemented by: AnimationComponent, CameraComponent, CameraOrbiterComponent, StateMachineComponent, TriggerComponent, PlayerControllerComponent, RigidBodyComponent, MeshComponent

onStaticModified(const char * slotName, const char * newValue)

Reimplemented from: SimObject

Reimplemented by: StateMachineComponent

ownerTransformSet(MatrixF * mat)

Reimplemented by: CollisionComponent, PlayerControllerComponent, RigidBodyComponent

packToStream(Stream & stream, U32 tabStop, S32 behaviorID, U32 flags)

processTick()

Reimplemented from: UpdateInterface

Reimplemented by: AnimationComponent, CameraOrbiterComponent, CollisionComponent, StateMachineComponent, TriggerComponent, PlayerControllerComponent, RigidBodyComponent

setDataField(StringTableEntry slotName, const char * array, const char * value)

setEnabled(bool toggle)

setOwner(Entity * pOwner)

Public Static Functions

_setEnabled(void * object, const char * index, const char * data)

initPersistFields()

setOwner(void * object, const char * index, const char * data)