Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Ndk::CollisionComponent2D Class Reference

NDK class that represents a two-dimensional collision geometry. More...

Inherits Ndk::Component< ComponentType >.

Public Member Functions

 CollisionComponent2D (Nz::Collider2DRef geom=Nz::Collider2DRef())
 Constructs a CollisionComponent2D object with a geometry. More...
 
 CollisionComponent2D (const CollisionComponent2D &collision)
 Constructs a CollisionComponent2D object by copy semantic. More...
 
Nz::Rectf GetAABB () const
 Gets the collision box representing the entity. More...
 
const Nz::Collider2DRefGetGeom () const
 Gets the geometry representing the entity. More...
 
void SetGeom (Nz::Collider2DRef geom)
 Sets geometry for the entity. More...
 
CollisionComponent2Doperator= (Nz::Collider2DRef geom)
 Assigns the geometry to this component. More...
 
CollisionComponent2Doperator= (CollisionComponent2D &&collision)=default
 

Static Public Attributes

static ComponentIndex componentIndex
 

Friends

class PhysicsSystem2D
 

Detailed Description

NDK class that represents a two-dimensional collision geometry.

Constructor & Destructor Documentation

◆ CollisionComponent2D() [1/2]

Ndk::CollisionComponent2D::CollisionComponent2D ( Nz::Collider2DRef  geom = Nz::Collider2DRef())
inline

Constructs a CollisionComponent2D object with a geometry.

Parameters
geomReference to a geometry symbolizing the entity

◆ CollisionComponent2D() [2/2]

Ndk::CollisionComponent2D::CollisionComponent2D ( const CollisionComponent2D collision)
inline

Constructs a CollisionComponent2D object by copy semantic.

Parameters
collisionCollisionComponent2D to copy

Member Function Documentation

◆ GetAABB()

Nz::Rectf Ndk::CollisionComponent2D::GetAABB ( ) const
inline

Gets the collision box representing the entity.

Returns
The physics collision box

◆ GetGeom()

const Nz::Collider2DRef & Ndk::CollisionComponent2D::GetGeom ( ) const
inline

Gets the geometry representing the entity.

Returns
A constant reference to the physics geometry

◆ operator=()

CollisionComponent2D & Ndk::CollisionComponent2D::operator= ( Nz::Collider2DRef  geom)
inline

Assigns the geometry to this component.

Returns
A reference to this
Parameters
geomReference to a geometry symbolizing the entity

◆ SetGeom()

void Ndk::CollisionComponent2D::SetGeom ( Nz::Collider2DRef  geom)

Sets geometry for the entity.

Parameters
geomGeometry used for collisions
Remarks
Produces a NazaraAssert if the entity has no physics component and has no static body

The documentation for this class was generated from the following files: