Box Class Reference

#include <Box.h>

Inheritance diagram for Box:
Collider InverseBox

# Public Member Functions

void constructor (Entity owner, const ColliderSpec *colliderSpec)
 Class' constructor.
override void resize (fixed_t sizeDelta)
override void configureWireframe ()
 Configure the wireframe used to show the collider.
override void print (int32 x, int32 y)
void getVertexes (Vector3D vertexes[8])
void projectOntoItself ()
 Project the box's vertexes onto its normals.

# Static Public Member Functions

static void project (Vector3D vertexes[8], Vector3D vector, fixed_t *min, fixed_t *max)

# Protected Attributes

VertexProjection vertexProjections [__COLLIDER_NORMALS]
 The normals of the box.
MeshSpecmeshSpec
 Mesh used to draw the collider.
RightBox rightBox
 Bounding box.
Normalsnormals
 The normals of the box.
Vector3D rotationVertexDisplacement

# Additional Inherited Members

- Private Types inherited from Collider
enum  CollisionResult
enum  ColliderClassIndexes
typedef const ColliderSpec ColliderROMSpec
- Private Member Functions inherited from Collider
void constructor (Entity owner, const ColliderSpec *colliderSpec)
 Class' constructor.
override bool onEvent (ListenerObject eventFirer, uint16 eventCode)
override bool handleMessage (Telegram telegram)
override void handleCommand (int32 command, va_list args)
void enable ()
 Enable the collider for collision checks.
void disable ()
 Disable the collider for collision checks.
void setLayers (uint32 layers)
uint32 getLayers ()
void setLayersToIgnore (uint32 layersToIgnore)
uint32 getLayersToIgnore ()
void checkCollisions (bool checkCollisions)
void registerCollisions (bool registerCollisions)
CollisionResult collides (Collider collider)
void resolveCollision (const CollisionInformation *collisionInformation)
bool canMoveTowards (Vector3D displacement)
void discardCollisions ()
 Discard any registered collision.
fixed_t getCollidingFrictionCoefficient ()
void show ()
 Show the collider.
void hide ()
 Hide the collider.
virtual Vector3D getNormal ()
- Private Attributes inherited from Collider
Vector3D position
 Displaced position.
VirtualList otherColliders
 List of colliding colliders.
uint32 layers
 Layers on which this collider live.
uint32 layersToIgnore
 Layers to ignore when checking for collisions.
Wireframe wireframe
 Wireframe to make the collider visible (mainly for debugging purposes)
bool enabled
 If false, it is ignored in all callision checks.
uint8 checkForCollisions
 If false, it doesn't check collision against other colliders.
bool registerCollisions
 If true, it registers other colliders when a collision arises.
uint8 classIndex
 Class index to avoid using __GET_CAST when checking for collisions.
bool invalidPosition
 Flag to force the computation of the collider's position.

# Detailed Description

Class Box

Inherits from Collider

Defines a collider with the shape of a box.

Definition at line 35 of file Box.h.

# Member Function Documentation

# configureWireframe()

void Box::configureWireframe ( )
virtual

Configure the wireframe used to show the collider.

Displacement

color

Transparency mode (__TRANSPARENCY_NONE, __TRANSPARENCY_EVEN or __TRANSPARENCY_ODD)

Flag to render the wireframe in interlaced mode

Implements Collider.

Definition at line 124 of file Box.c.

# constructor()

void Box::constructor ( Entity owner,
const ColliderSpec * colliderSpec )

Class' constructor.

Definition at line 64 of file Box.c.

# getVertexes()

void Box::getVertexes ( Vector3D vertexes[8])

Retrieve the vertexes that define the box.

Parameters
vertexesArray of vectors that define the box

Definition at line 228 of file Box.c.

# print()

void Box::print ( int32 x,
int32 y )
virtual

Print collider's state.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Reimplemented from Collider.

Definition at line 203 of file Box.c.

# project()

static void Box::project ( Vector3D vertexes[8],
Vector3D vector,
fixed_t * min,
fixed_t * max )
static

Project the vertexes onto the provided vector.

Parameters
vertexesArray of vectors to project
vectorVector onto which make the projections
minmin: Variable to store the value of the lowest value of the projection
maxmax: Variable to store the value of the biggest value of the projection

Definition at line 27 of file Box.c.

# projectOntoItself()

void Box::projectOntoItself ( )

Project the box's vertexes onto its normals.

Definition at line 292 of file Box.c.

# resize()

void Box::resize ( fixed_t sizeDelta)
virtual

Resize the colliders add the provided increment.

Parameters
sizeDeltaDelta to add to the collider's size

Reimplemented from Collider.

Definition at line 107 of file Box.c.

# Member Data Documentation

# meshSpec

MeshSpec* Box::meshSpec
protected

Mesh used to draw the collider.

Definition at line 43 of file Box.h.

# normals

Normals* Box::normals
protected

The normals of the box.

Definition at line 50 of file Box.h.

# rightBox

RightBox Box::rightBox
protected

Bounding box.

Definition at line 46 of file Box.h.

# rotationVertexDisplacement

Vector3D Box::rotationVertexDisplacement
protected

Definition at line 53 of file Box.h.

# vertexProjections

VertexProjection Box::vertexProjections[__COLLIDER_NORMALS]
protected

The normals of the box.

Definition at line 40 of file Box.h.


The documentation for this class was generated from the following files:
  • VUEngine-Core/source/Component/Collider/Box/Box.h
  • VUEngine-Core/source/Component/Collider/Box/Box.c