Container Class Reference
#include <Container.h>
![](../class_container.png)
# Public Member Functions | |
void | constructor (int16 internalId, const char *const name) |
override void | setDirection (const Vector3D *direction) |
override void | show () |
Make this instance visible. | |
override void | hide () |
Make this instance invisible. | |
override void | setTransparency (uint8 transparency) |
override void | setPosition (const Vector3D *position) |
override void | setRotation (const Rotation *rotation) |
override void | setScale (const Scale *scale) |
void | setNormalizedDirection (NormalizedDirection normalizedDirection) |
NormalizedDirection | getNormalizedDirection () |
void | deleteMyself () |
int16 | getInternalId () |
void | setName (const char *const name) |
const char * | getName () |
void | streamOut (bool streamOut) |
Container | getParent () |
void | addChild (Container child) |
void | removeChild (Container child, bool deleteChild) |
void | purgeChildren () |
Force the destruction of all children marked to be deleted. | |
bool | getChildren (ClassPointer classPointer, VirtualList children) |
Container | getChildById (int16 id) |
Container | getChildByName (const char *childName, bool recursive) |
Container | getChildAtPosition (int16 position) |
int32 | getChildrenCount () |
Container | getFirstAncestor () |
Container | getRelativeByName (const char *relativeName) |
void | updateChildren () |
Update the children of this container. | |
void | invalidateTransformation () |
void | transformChildren (uint8 invalidateTransformationFlag) |
void | propagateCommand (uint32 command,...) |
bool | propagateMessage (bool(*propagatedMessageHandler)(void *, va_list),...) |
bool | onPropagatedMessage (va_list args) |
bool | propagateString (bool(*propagatedMessageHandler)(void *, va_list),...) |
bool | onPropagatedString (va_list args) |
void | translate (const Vector3D *translation) |
void | rotate (const Rotation *rotation) |
void | scale (const Scale *scale) |
const Vector3D * | getLocalPosition () |
const Rotation * | getLocalRotation () |
const Scale * | getLocalScale () |
virtual void | setLocalPosition (const Vector3D *position) |
virtual void | setLocalRotation (const Rotation *rotation) |
virtual void | setLocalScale (const Scale *scale) |
virtual void | ready (bool recursive) |
virtual void | transform (const Transformation *environmentTransform, uint8 invalidateTransformationFlag) |
virtual void | update () |
Update this instance's logic. | |
virtual void | suspend () |
Prepare to suspend this instance's logic. | |
virtual void | resume () |
Prepare to resume this instance's logic. | |
virtual void | handleCommand (int32 command, va_list args) |
virtual bool | handlePropagatedMessage (int32 message) |
virtual bool | handlePropagatedString (const char *string) |
# Protected Attributes | |
Container | parent |
Container of which this one is a child. | |
VirtualList | children |
Transformation | localTransformation |
3D local transformation | |
char * | name |
Container's name. | |
int16 | internalId |
Container's internal id, set by the engine. | |
bool | deleteMe |
If true, the parent will delete this container when appropriate. | |
bool | ready |
bool | dontStreamOut |
bool | hidden |
Flag to mark the container (and its children) as non visible. | |
int8 | axisForSynchronizationWithBody |
Axises around which to rotate the container when syncronizing with body. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
override bool | handleMessage (Telegram telegram) |
void | clearComponentLists (uint32 componentType) |
Component | addComponent (const ComponentSpec *componentSpec) |
void | removeComponent (Component component) |
void | addComponents (ComponentSpec **componentSpecs, uint32 componentType) |
void | removeComponents (uint32 componentType) |
Component | getComponentAtIndex (uint32 componentType, int16 componentIndex) |
VirtualList | getComponents (uint32 componentType) |
bool | getComponentsOfClass (ClassPointer classPointer, VirtualList components, uint32 componentType) |
uint16 | getComponentsCount (uint32 componentType) |
void | resetComponents () |
Reset components. | |
void | setVisible () |
Set this instance's visibility flag up. | |
const Transformation * | getTransformation () |
const Vector3D * | getPosition () |
const Rotation * | getRotation () |
const Scale * | getScale () |
Body | getBody () |
bool | isMoving () |
void | stopAllMovement () |
Stop all entity's movement. | |
void | stopMovement (uint16 axis) |
bool | setVelocity (const Vector3D *velocity, bool checkIfCanMove) |
const Vector3D * | getVelocity () |
fixed_t | getSpeed () |
fixed_t | getMaximumSpeed () |
fixed_t | getBounciness () |
fixed_t | getFrictionCoefficient () |
void | enableCollisions () |
Enable collision detection on the entity's colliders. | |
void | disableCollisions () |
Disable collision detection on the entity's colliders. | |
void | checkCollisions (bool activate) |
void | registerCollisions (bool activate) |
void | setCollidersLayers (uint32 layers) |
uint32 | getCollidersLayers () |
void | setCollidersLayersToIgnore (uint32 layersToIgnore) |
uint32 | getCollidersLayersToIgnore () |
bool | hasColliders () |
void | showColliders () |
Make the entity's colliders visible. | |
void | hideColliders () |
Make the entity's colliders invisible. | |
virtual void | createComponents (ComponentSpec **componentSpecs) |
virtual void | destroyComponents () |
Destroy the components that attach to this container. | |
virtual void | addedComponent (Component component) |
virtual void | removedComponent (Component component) |
virtual void | calculateSize () |
Configure the entity's size. | |
virtual fixed_t | getRadius () |
virtual const Vector3D * | getDirection () |
virtual bool | applyForce (const Vector3D *force, bool checkIfCanMove) |
virtual bool | canMoveTowards (Vector3D direction) |
virtual bool | isSensibleToCollidingObjectBouncinessOnCollision (Entity collidingEntity) |
virtual bool | isSensibleToCollidingObjectFrictionOnCollision (Entity collidingEntity) |
virtual bool | isSubjectToGravity (Vector3D gravity) |
virtual bool | collisionStarts (const CollisionInformation *collisionInformation) |
virtual void | collisionPersists (const CollisionInformation *collisionInformation) |
virtual void | collisionEnds (const CollisionInformation *collisionInformation) |
virtual uint32 | getInGameType () |
![]() | |
VirtualList * | components |
Linked list of attached components. | |
Transformation | transformation |
3D transformation | |
Body | body |
bool | isVisible |
Flag used for streaming purposes. |
# Detailed Description
Class Container
Inherits from Entity
Adds parenting cababilities to spatial objects.
Definition at line 41 of file Container.h.
# Member Function Documentation
# addChild()
void Container::addChild | ( | Container | child | ) |
Add a container as a child.
- Parameters
-
child Container to be added as a child
Definition at line 406 of file Container.c.
# constructor()
void Container::constructor | ( | int16 | internalId, |
const char *const | name ) |
Class' constructor
- Parameters
-
internalId ID to keep track internally of the new instance name Name to assign to the new instance
Definition at line 35 of file Container.c.
# deleteMyself()
void Container::deleteMyself | ( | ) |
Delete this container when appropriate. Containers must not be deleted nor created directly by the client code
Definition at line 334 of file Container.c.
# getChildAtPosition()
Retrieve the child at the provided position in the linked list of children.
- Parameters
-
position Position in the linked list of children
- Returns
- The child container at the provided position if any
Definition at line 614 of file Container.c.
# getChildById()
Retrieve a child of this container whose internal ID equals the provided one.
- Parameters
-
id Internal ID to look for
- Returns
- Child container whose ID matches the provided one
Definition at line 573 of file Container.c.
# getChildByName()
Find a child with the provided name.
- Parameters
-
childName Name to look for recursive If true, the seach extends to grand children, grand grand children, etc.
- Returns
- The first child container whose name equals the provided one
Definition at line 593 of file Container.c.
# getChildren()
bool Container::getChildren | ( | ClassPointer | classPointer, |
VirtualList | children ) |
Retrieve the linked list of children that are instances of the provided class.
- Parameters
-
classPointer Pointer to the class to use as search criteria. Usage: typeofclass(ClassName) children Linked list to be filled with the children that meed the search criteria (it is externally allocated and must be externally deleted)
- Returns
- True if one or more children met the search criteria; false otherwise
Definition at line 551 of file Container.c.
# getChildrenCount()
int32 Container::getChildrenCount | ( | ) |
Retrieve the amount of children of this container.
- Returns
- Amount of children of this container
Definition at line 626 of file Container.c.
# getFirstAncestor()
Container Container::getFirstAncestor | ( | ) |
Retrieve the first ancestor.
- Returns
- The first ancestor of the container.
Definition at line 633 of file Container.c.
# getInternalId()
int16 Container::getInternalId | ( | ) |
Retrieve the container's internal id used by the engine to keep track of it.
- Returns
- Container's internal id
Definition at line 378 of file Container.c.
# getLocalPosition()
const Vector3D * Container::getLocalPosition | ( | ) |
Retrieve the local position.
- Returns
- Pointer to the local transformation's position
Definition at line 871 of file Container.c.
# getLocalRotation()
const Rotation * Container::getLocalRotation | ( | ) |
Retrieve the local rotation.
- Returns
- Pointer to the local transformation's rotation
Definition at line 878 of file Container.c.
# getLocalScale()
const Scale * Container::getLocalScale | ( | ) |
Retrieve the local scale.
- Returns
- Pointer to the local transformation's scale
Definition at line 885 of file Container.c.
# getName()
const char * Container::getName | ( | ) |
Retrive the container's name.
- Returns
- Pointer to the container's name
Definition at line 385 of file Container.c.
# getNormalizedDirection()
NormalizedDirection Container::getNormalizedDirection | ( | ) |
Retrieve the normalized direction towards where the container faces.
- Returns
- Container's facing direction with is components normalized
Definition at line 307 of file Container.c.
# getParent()
Container Container::getParent | ( | ) |
Retrieve this container's parent container.
- Returns
- Parent container
Definition at line 399 of file Container.c.
# getRelativeByName()
Container Container::getRelativeByName | ( | const char * | relativeName | ) |
Find a relative in the whole hierarchy of containers with the provided name.
- Parameters
-
relativeName Name to look for
- Returns
- The first container whose name equals the provided one
Definition at line 647 of file Container.c.
# handleCommand()
|
virtual |
Default command handler.
- Parameters
-
command Propagated command args Variable arguments list depending on the command to handle
Reimplemented in Actor.
Definition at line 1056 of file Container.c.
# handlePropagatedMessage()
Default interger message handler for propagateMessage
- Parameters
-
message Propagated integer message
- Returns
- True if the propagation must stop; false if the propagation must reach other containers
Definition at line 1061 of file Container.c.
# handlePropagatedString()
|
virtual |
Default string handler for propagateString
- Parameters
-
string Propagated string
- Returns
- True if the propagation must stop; false if the propagation must reach other containers
Reimplemented in Actor.
Definition at line 1068 of file Container.c.
# hide()
|
virtual |
Make this instance invisible.
Reimplemented from Entity.
Reimplemented in ParticleSystem.
Definition at line 151 of file Container.c.
# invalidateTransformation()
void Container::invalidateTransformation | ( | ) |
Invalidate the transformation to force it to be recomputed in the next game cycle.
Definition at line 701 of file Container.c.
# onPropagatedMessage()
bool Container::onPropagatedMessage | ( | va_list | args | ) |
Generic integer message propagator
- Parameters
-
args Variable list of propagated arguments
Definition at line 797 of file Container.c.
# onPropagatedString()
bool Container::onPropagatedString | ( | va_list | args | ) |
Generic string propagator
- Parameters
-
args Variable list of propagated arguments
Definition at line 819 of file Container.c.
# propagateCommand()
void Container::propagateCommand | ( | uint32 | command, |
... ) |
Propagate a command to the container's children.
- Parameters
-
command Method that handles the message ... Variable arguments list depending on the command
- Returns
- The result that the provided message handler returns
Definition at line 758 of file Container.c.
# propagateMessage()
Propagate an integer message through the whole parenting hierarchy (children, grand children, etc.).
- Parameters
-
propagatedMessageHandler Method that handles the message ... Variable arguments list depending on the message
- Returns
- The result that the provided message handler returns
Definition at line 783 of file Container.c.
# propagateString()
Propagate a string through the whole parenting hierarchy (children, grand children, etc.).
- Parameters
-
propagatedMessageHandler Method that handles the string ... Variable arguments list depending on the string
- Returns
- The result that the provided string handler returns
Definition at line 805 of file Container.c.
# purgeChildren()
void Container::purgeChildren | ( | ) |
Force the destruction of all children marked to be deleted.
Definition at line 507 of file Container.c.
# ready()
|
virtual |
Make the container ready to start operating once it has been completely intialized.
- Parameters
-
recursive If true, the ready call is propagated to its children, grand children, etc.
Reimplemented in Actor.
# removeChild()
Reomve a child container for this container's children list.
- Parameters
-
child Container to be remove as a child deleteChild If true, the child will be deleted in the next game cycle
Definition at line 460 of file Container.c.
# resume()
|
virtual |
Prepare to resume this instance's logic.
Reimplemented in Actor, ParticleSystem, and Stage.
Definition at line 1030 of file Container.c.
# rotate()
void Container::rotate | ( | const Rotation * | rotation | ) |
Rotate the container.
- Parameters
-
rotation Rotation to be added to the container's rotation
Definition at line 850 of file Container.c.
# scale()
void Container::scale | ( | const Scale * | scale | ) |
Scale the container.
- Parameters
-
scale Scale to be applied to the container's scale
Definition at line 862 of file Container.c.
# setDirection()
|
virtual |
Set the direction towards which the object must move.
- Parameters
-
direction Pointer to a direction vector
Reimplemented from Entity.
Definition at line 210 of file Container.c.
# setLocalPosition()
|
virtual |
Set the local position.
- Parameters
-
position New local position
Definition at line 892 of file Container.c.
# setLocalRotation()
|
virtual |
Set the local rotation.
- Parameters
-
rotation New local rotation
Definition at line 933 of file Container.c.
# setLocalScale()
|
virtual |
# setName()
void Container::setName | ( | const char *const | name | ) |
Set the container's name.
- Parameters
-
name Name to assign to the instance
Definition at line 351 of file Container.c.
# setNormalizedDirection()
void Container::setNormalizedDirection | ( | NormalizedDirection | normalizedDirection | ) |
Set the normalized direction towards where the container faces.
- Parameters
-
normalizedDirection New facing direction with is components normalized
Definition at line 271 of file Container.c.
# setPosition()
|
virtual |
Set the container's position.
- Parameters
-
position 3D vector defining the object's new position
Reimplemented from Entity.
Definition at line 177 of file Container.c.
# setRotation()
|
virtual |
Set the container's rotation.
- Parameters
-
rotation Rotation
Reimplemented from Entity.
Definition at line 188 of file Container.c.
# setScale()
|
virtual |
Set the container's scale.
- Parameters
-
scale Scale
Reimplemented from Entity.
Definition at line 199 of file Container.c.
# setTransparency()
|
virtual |
Set this instance's transparency effects.
- Parameters
-
transparency Transparecy effect (__TRANSPARENCY_NONE, __EVEN or __ODD)
Reimplemented from Entity.
Reimplemented in ParticleSystem.
Definition at line 165 of file Container.c.
# show()
|
virtual |
Make this instance visible.
Reimplemented from Entity.
Reimplemented in ParticleSystem.
Definition at line 135 of file Container.c.
# streamOut()
void Container::streamOut | ( | bool | streamOut | ) |
Set the streaming effects on this container.
- Parameters
-
streamOut If false, this container won't be streamed out when outside of the camera's reach
Definition at line 392 of file Container.c.
# suspend()
|
virtual |
Prepare to suspend this instance's logic.
Reimplemented in Actor, ParticleSystem, and Stage.
Definition at line 1011 of file Container.c.
# transform()
|
virtual |
Compute the container's global transformation.
- Parameters
-
environmentTransform Reference environment for the local transformation invalidateTransformationFlag Flag that determines which transfomation's components must be recomputed
Reimplemented in UIContainer.
Definition at line 997 of file Container.c.
# transformChildren()
void Container::transformChildren | ( | uint8 | invalidateTransformationFlag | ) |
Apply the transformations to this container's children.
- Parameters
-
invalidateTransformationFlag Flag that determines which transfomation's components must be recomputed
Force non virtual call
Definition at line 718 of file Container.c.
# translate()
void Container::translate | ( | const Vector3D * | translation | ) |
Displace the container.
- Parameters
-
translation Displacement to be added to the container's position
Definition at line 827 of file Container.c.
# update()
|
virtual |
Update this instance's logic.
Reimplemented in ParticleSystem.
Definition at line 1004 of file Container.c.
# updateChildren()
void Container::updateChildren | ( | ) |
Update the children of this container.
Definition at line 656 of file Container.c.
# Member Data Documentation
# axisForSynchronizationWithBody
|
protected |
Axises around which to rotate the container when syncronizing with body.
Definition at line 75 of file Container.h.
# children
|
protected |
Linked list of child containers The VB's CPU doesn't have data cache, so there is not a good reason to loose generality
Definition at line 51 of file Container.h.
# deleteMe
|
protected |
If true, the parent will delete this container when appropriate.
Definition at line 63 of file Container.h.
# dontStreamOut
|
protected |
Definition at line 69 of file Container.h.
# hidden
|
protected |
Flag to mark the container (and its children) as non visible.
Definition at line 72 of file Container.h.
# internalId
|
protected |
Container's internal id, set by the engine.
Definition at line 60 of file Container.h.
# localTransformation
|
protected |
3D local transformation
Definition at line 54 of file Container.h.
# name
|
protected |
Container's name.
Definition at line 57 of file Container.h.
# parent
|
protected |
Container of which this one is a child.
Definition at line 46 of file Container.h.
# ready
|
protected |
Definition at line 66 of file Container.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Entity/Container/Container.h
- VUEngine-Core/source/Entity/Container/Container.c