Bowls
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Ball Class Reference

Class that represents a Ball. More...

#include <Ball.h>

Inheritance diagram for Ball:
Inheritance graph
Collaboration diagram for Ball:
Collaboration graph

Public Member Functions

 Ball (cgg::Mat43)
 
 Ball (cgg::Mat43, cgg::Vec3, float)
 
 Ball (cgg::Vec3)
 
 Ball (cgg::Vec3, cgg::Vec3, float)
 
void render (gl::Primitives *)
 
float getRadius ()
 
float getThrow ()
 
- Public Member Functions inherited from CollisionEntity
 CollisionEntity (cgg::Mat43)
 
 CollisionEntity (cgg::Mat43, cgg::Vec3)
 
 CollisionEntity (cgg::Vec3)
 
 CollisionEntity (cgg::Vec3, cgg::Vec3)
 
void updateXVelocity (float)
 
void updateYVelocity (float)
 
void updateZVelocity (float)
 
float getXVelocity ()
 
float getYVelocity ()
 
float getZVelocity ()
 
- Public Member Functions inherited from Entity
 Entity (cgg::Mat43)
 
 Entity (cgg::Mat43, cgg::Vec3)
 
 Entity (cgg::Vec3)
 
 Entity (cgg::Vec3, cgg::Vec3)
 
void changePosition (cgg::Vec3)
 
void updatePosition (cgg::Vec3)
 
cgg::Vec3 getPosition ()
 
void updateColour (cgg::Vec3)
 

Protected Attributes

float radius
 Contains the radius of the sphere. More...
 
float maxThrowStrength
 the maximum the ball can be thrown More...
 
- Protected Attributes inherited from Entity
cgg::Mat43 transform
 cgg::Mat43 containing a transform (position,rotation,scale). More...
 
cgg::Vec3 colour
 cgg::Vec3 containing a colour's r,g,b values. More...
 

Detailed Description

Class that represents a Ball.

Class that contains a ball and its interactions with the game.

Definition at line 14 of file Ball.h.

Constructor & Destructor Documentation

Ball::Ball ( cgg::Mat43  )

Create a Ball object

Creates a Ball object using the passed in transform. Colour and radius are set to internal defaults.

Parameters
cgg::Mat43- The transformation matrix
Ball::Ball ( cgg::Mat43  ,
cgg::Vec3  ,
float   
)

Create a Ball object

Creates a Ball object using the passed in transform, colour and radius.

Parameters
cgg::Mat43- The transformation matrix
cgg::Vec3- Contains the colour r,g,b values
float- Float value containing the radius of the sphere
Ball::Ball ( cgg::Vec3  )

Create a Ball object

Creates a Ball object using the passed in transform. Colour and radius are set to internal defaults.

Parameters
cgg::Vec3- Position
Ball::Ball ( cgg::Vec3  ,
cgg::Vec3  ,
float   
)

Create a Ball object

Creates a Ball object using the passed in transform, colour and radius.

Parameters
cgg::Vec3- Position
cgg::Vec3- Contains the colour r,g,b values
float- Float value containing the radius of the sphere

Member Function Documentation

float Ball::getRadius ( )

Returns the radius

Returns
float the radius
float Ball::getThrow ( )

Returns the max throw strength

float the max throw strength

void Ball::render ( gl::Primitives *  )
virtual

Renders a sphere

Creates a sphere using the objects internal values and passes it into primitiveList.

Parameters
gl::Primitives*- Pointer to a list of primitives

Implements Entity.

Reimplemented in Bowl, and Jack.

Member Data Documentation

float Ball::maxThrowStrength
protected

the maximum the ball can be thrown

Definition at line 87 of file Ball.h.

float Ball::radius
protected

Contains the radius of the sphere.

Definition at line 84 of file Ball.h.


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