Wraith  0.1.5
Basic 3D game engine in C++
CollisionVolumeBSphere Class Reference

A Collision Volume Bsphere. More...

#include <CollisionVolumeBSphere.h>

Inheritance diagram for CollisionVolumeBSphere:
Inheritance graph
Collaboration diagram for CollisionVolumeBSphere:
Collaboration graph

Public Member Functions

 CollisionVolumeBSphere (const CollisionVolumeBSphere &)=default
 
CollisionVolumeBSphereoperator= (const CollisionVolumeBSphere &)=default
 
 CollisionVolumeBSphere (CollisionVolumeBSphere &&)=default
 
CollisionVolumeBSphereoperator= (CollisionVolumeBSphere &&)=default
 
virtual void computeData (Model *pModel, const Matrix &worldMatrix) override
 Calculates the data for BSphere. In this case the radius and center position. More...
 
void computeData (const CollisionVolumeOBB &OBB)
 Calculates the data for BSphere. In this case the radius and center position. More...
 
void computeData (const Triangle &triangle)
 Calculates the data for BSphere. In this case the radius and center position. More...
 
virtual bool intersectAccept (const CollisionVolume &) const override
 Accepts a collision volume to perform intersect test. More...
 
virtual bool intersectVisitor (const CollisionVolumeBSphere &) const override
 Visits a collision volume BSphere to perform intersect test. More...
 
virtual bool intersectVisitor (const CollisionVolumeAABB &) const override
 Visits a collision volume AABB to perform intersect test. More...
 
virtual bool intersectVisitor (const CollisionVolumeOBB &) const override
 Visits a collision volume OBB to perform intersect test. More...
 
virtual bool intersectVisitor (const CollisionVolumeOctree &) const override
 Visits a collision volume Octree to perform intersect test. More...
 
const Vect & getCenter () const
 Gets the center position of BSphere. More...
 
float getRadius () const
 Gets the radius of the BSphere. More...
 
virtual int getMaxDepth () const override
 
- Public Member Functions inherited from CollisionVolume
 CollisionVolume (const CollisionVolume &)=default
 
CollisionVolumeoperator= (const CollisionVolume &)=default
 
 CollisionVolume (CollisionVolume &&)=default
 
CollisionVolumeoperator= (CollisionVolume &&)=default
 

Private Member Functions

virtual void debugDraw (const Vect &color, int depth) const override
 Draws it collision volume. More...
 

Private Attributes

Vect _center
 
float _radius
 

Detailed Description

A Collision Volume Bsphere.

inherits from CollisionVolume.

Member Function Documentation

◆ computeData() [1/3]

void CollisionVolumeBSphere::computeData ( const CollisionVolumeOBB OBB)

Calculates the data for BSphere. In this case the radius and center position.

Parameters
OBBthe OBB.

◆ computeData() [2/3]

void CollisionVolumeBSphere::computeData ( const Triangle triangle)

Calculates the data for BSphere. In this case the radius and center position.

Parameters
trianglethe triangle.

◆ computeData() [3/3]

void CollisionVolumeBSphere::computeData ( Model *  pModel,
const Matrix &  worldMatrix 
)
overridevirtual

Calculates the data for BSphere. In this case the radius and center position.

Parameters
pModelthe pointer to a model.
worldMatrixThe world matrix.

Implements CollisionVolume.

◆ debugDraw()

void CollisionVolumeBSphere::debugDraw ( const Vect &  color,
int  depth 
) const
overrideprivatevirtual

Draws it collision volume.

Used for debuggin purposes. Depth value is used only for Octree collision value. All other collision volumes ignore it.

Parameters
colorthe color to render the collision volume.
depththe depth to render collision volume.

Implements CollisionVolume.

◆ getCenter()

const Vect & CollisionVolumeBSphere::getCenter ( ) const

Gets the center position of BSphere.

Returns
The center.

◆ getRadius()

float CollisionVolumeBSphere::getRadius ( ) const

Gets the radius of the BSphere.

Returns
The radius.

◆ intersectAccept()

bool CollisionVolumeBSphere::intersectAccept ( const CollisionVolume collisionVolume) const
overridevirtual

Accepts a collision volume to perform intersect test.

Uses Visitor Pattern. This is the first step of the process. Then calls on intersectVisitor().

Parameters
collisionVolumea collision volume.

Implements CollisionVolume.

◆ intersectVisitor() [1/4]

bool CollisionVolumeBSphere::intersectVisitor ( const CollisionVolumeAABB AABB) const
overridevirtual

Visits a collision volume AABB to perform intersect test.

Uses Visitor Pattern. This is the second step of the process.

Parameters
AABBa collision volume AABB.

Implements CollisionVolume.

◆ intersectVisitor() [2/4]

bool CollisionVolumeBSphere::intersectVisitor ( const CollisionVolumeBSphere collisionBSphere) const
overridevirtual

Visits a collision volume BSphere to perform intersect test.

Uses Visitor Pattern. This is the second step of the process.

Parameters
collisionBSpherea collision volume BSphere.

Implements CollisionVolume.

◆ intersectVisitor() [3/4]

bool CollisionVolumeBSphere::intersectVisitor ( const CollisionVolumeOBB OBB) const
overridevirtual

Visits a collision volume OBB to perform intersect test.

Uses Visitor Pattern. This is the second step of the process.

Parameters
OBBa collision volume OBB.

Implements CollisionVolume.

◆ intersectVisitor() [4/4]

bool CollisionVolumeBSphere::intersectVisitor ( const CollisionVolumeOctree Octree) const
overridevirtual

Visits a collision volume Octree to perform intersect test.

Uses Visitor Pattern. This is the second step of the process.

Parameters
Octreea collision volume Octree.

Implements CollisionVolume.


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