cs sdk v 1.14 released

Home  |  Product  |  Documents  |  Tutorials  |  FAQ |   Download  |   Forum |   Contacts  |   Link  


  Cross Suit

 Cross Suit SDK

 Documents
      classes
 Starting...
           Tutorials

 LUA tutorials

   Support

  Forum
  q&a

 Product parts

 Virtual File system

 Virtual Render
 Virtual Machine
   

  Demo Games

   

 3D Engine

  gvSystem(dx9)

 Link

 

 

gv_gameobject2d Class Reference

#include <gv_gameobject2d.h>

Inheritance diagram for gv_gameobject2d:

Inheritance graph
[legend]
Collaboration diagram for gv_gameobject2d:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~gv_gameobject2d ()
virtual void Input ()
virtual void Update ()
virtual void Render2D ()
virtual void Collision (gv_gameobject2d *object)
bool CheckIntersection (const gv_gameobject2d *p_Object) const
float CheckCircleIntersection (const gv_gameobject2d *p_Object) const
void SetTranslation (const XVECTOR2 &translation)
XVECTOR2 GetTranslation () const
void SetCenterTranslation (const XVECTOR2 &translation)
XVECTOR2 GetCenterTranslation () const
void SetLocation (const XVECTOR2 &location)
XVECTOR2 GetLocation () const
void SetCenterLocation (const XVECTOR2 &location)
XVECTOR2 GetCenterLocation () const
void SetRotationCenter (const XVECTOR2 &rotationCenter)
XVECTOR2 GetRotationCenter () const
void SetRotation (const float &rotation)
float GetRotation () const
void SetScaling (const XVECTOR2 &scaling)
XVECTOR2 GetScaling () const
void SetModulateColor (unsigned long modulateColor)
unsigned long GetModulateColor () const
void SetWidth (const float &width)
float GetWidth () const
float GetScaledWidth () const
void SetHeight (const float &height)
float GetHeight () const
float GetScaledHeight () const
void SetBoundingRadius (const float &boundingRadius)
float GetBoundingRadius () const
XVECTOR2 GetCenter () const
XVECTOR2 GetScaledCenter () const
void SetObjectType (OBJECT_TYPE objectType)
OBJECT_TYPE GetObjectType () const
void SetVelocity (const XVECTOR2 &velocity)
XVECTOR2 GetVelocity () const
void SetName (char *szName)
char * GetName () const

Protected Member Functions

 gv_gameobject2d ()

Protected Attributes

XVECTOR2 location
 location
XVECTOR2 rotationCenter
 center
float rotation
 rotation increasing CCW
XVECTOR2 scaling
 size multiplier (.5 = half size, 1.0 = full size, 2.0 = float, etc)
unsigned long modulateColor
 alpha values for object (alpha, red, green, blue)
float width
 unscaled width of object
float height
 unscaled height of object
float boundingRadius
 bounding radius
OBJECT_TYPE objectType
 type of object (defined in enum above)
XVECTOR2 velocity
 current object speed
char * name
 arbitrary, helps in debugging

Detailed Description

Definition at line 21 of file gv_gameobject2d.h.


Constructor & Destructor Documentation

virtual gv_gameobject2d::~gv_gameobject2d (  )  [virtual]

default destructor.

Does not do anything for performance reasons.

gv_gameobject2d::gv_gameobject2d (  )  [protected]

protected default constructor because this class is abstract


Member Function Documentation

virtual void gv_gameobject2d::Input (  )  [virtual]

check input related to this object.

Does not do anything, the class that inherits this should do any necessary stuff here.

virtual void gv_gameobject2d::Update (  )  [virtual]

update this object.

Does not do anything, the class that inherits this should do any necessary stuff here.

virtual void gv_gameobject2d::Render2D (  )  [virtual]

draw this object.

Does not do anything, the class that inherits this should do any necessary stuff here.

virtual void gv_gameobject2d::Collision ( gv_gameobject2d object  )  [virtual]

this object has collided with another object

Parameters:
object the object it collided with
Does not do anything, the class that inherits this should do any necessary stuff here.

bool gv_gameobject2d::CheckIntersection ( const gv_gameobject2d p_Object  )  const

Collision detection based on height & width

Parameters:
p_Object the object to check for a collision with
Returns:
whether or not the objects collided
See also:
CheckCircleIntersection
Does simple bounding box collision detection based on both objects' height and width. The objects' height and width must be set before calling this function.

float gv_gameobject2d::CheckCircleIntersection ( const gv_gameobject2d p_Object  )  const

Collision detection based on boundingRadius

Parameters:
p_Object the object to check for a collision with
Returns:
a float representing how much the objects overlap, a negative or zero value means they do not overlap
See also:
CheckIntersection
Does simple bounding circle collision detection based on both objects' boundingRadius. The objects' boundingRadius must be set before calling this function.

void gv_gameobject2d::SetTranslation ( const XVECTOR2 translation  ) 

set current translation

Parameters:
translation the new translation
Sets this game object's translation.

XVECTOR2 gv_gameobject2d::GetTranslation (  )  const

get current translation

Returns:
this game object's current translation
See also:
SetTranslation
Gets this game object's current translation.

void gv_gameobject2d::SetCenterTranslation ( const XVECTOR2 translation  ) 

set this object's center translation

Parameters:
translation the new center translation
Set this object's translation by specifying where the center of the object should be in translation coordinates. Height and width must be defined before calling this function.

XVECTOR2 gv_gameobject2d::GetCenterTranslation (  )  const

get this object's center translation

Returns:
this object's current center translation
See also:
SetCenterTranslation
Gets this object's current center transalation. Height and width must be defined before calling this function.

void gv_gameobject2d::SetLocation ( const XVECTOR2 location  ) 

set this object's location

Parameters:
location the new location
Set this object's location.

XVECTOR2 gv_gameobject2d::GetLocation (  )  const

get this object's location

Returns:
the object's current location
See also:
SetLocation
Get this object's current location.

void gv_gameobject2d::SetCenterLocation ( const XVECTOR2 location  ) 

set this object's center location

Parameters:
location the new center location
Set this object's location by specifying where the center of the object should be in location coordinates. Height and width must be defined before calling this function.

XVECTOR2 gv_gameobject2d::GetCenterLocation (  )  const

get this object's center location

Returns:
the object's current center location
See also:
SetCenterLocation
Get this object's center location. Height and width must be defined before calling this function.

void gv_gameobject2d::SetRotationCenter ( const XVECTOR2 rotationCenter  ) 

rotation center, relative to height and width

Parameters:
rotationCenter the object's center
Rotation center is used in DirectX sprite rendering functions.

XVECTOR2 gv_gameobject2d::GetRotationCenter (  )  const

get rotation center

Returns:
this object's rotation center
See also:
SetRotationCenter

void gv_gameobject2d::SetRotation ( const float &  rotation  ) 

rotation, in radians, increases counter-clockwise

Parameters:
rotation new rotation in radians
Rotation is used in DirectX sprite rendering functions.

float gv_gameobject2d::GetRotation (  )  const

get rotation

Returns:
this object's rotation
See also:
SetRotation

void gv_gameobject2d::SetScaling ( const XVECTOR2 scaling  ) 

scaling, (1,1) is original size

Parameters:
scaling the new x and y axis scaling
Scaling is done per axis. Set x and y components equal to each other to scale the whole object as a unit. Set to 1 for original size

XVECTOR2 gv_gameobject2d::GetScaling (  )  const

get this object's scaling

Returns:
this object's scaling
See also:
SetScaling

void gv_gameobject2d::SetModulateColor ( unsigned long  modulateColor  ) 

modulate color, ARGB(255,255,255,255) is original color

Parameters:
modulateColor is used to put the sprite through a color filter
Set to D3DCOLOR_ARGB(255,255,255,255) to use the sprite's original color

unsigned long gv_gameobject2d::GetModulateColor (  )  const

get this object's modulate color

Returns:
this object's modulate color
See also:
SetModulateColor

void gv_gameobject2d::SetWidth ( const float &  width  ) 

set width of object

Parameters:
width the new width of the object
This width is independant of the sprite's width.

float gv_gameobject2d::GetWidth (  )  const

get width of object

Returns:
the current width of the object
See also:
SetWidth

float gv_gameobject2d::GetScaledWidth (  )  const

get width of object using scaling

Returns:
this object's width times it's x scaling
This function simply multiplies it's x (width) scaling with it's width and returns that value.

void gv_gameobject2d::SetHeight ( const float &  height  ) 

set height of object

Parameters:
height new height of object
This height is independant of the sprite's height.

float gv_gameobject2d::GetHeight (  )  const

get height of object

Returns:
the current height of object
See also:
SetHeight

float gv_gameobject2d::GetScaledHeight (  )  const

height of object using scaling

Returns:
this object's height times it's y scaling
This function simply multiplies it's y (height) scaling with it's height and returns that value.

void gv_gameobject2d::SetBoundingRadius ( const float &  boundingRadius  ) 

bounding radius, usually 1/2 width

Parameters:
boundingRadius the new bounding radius of this object.
Bounding radius is used in bounding circle collision detection.

float gv_gameobject2d::GetBoundingRadius (  )  const

get bounding radius of object

Returns:
the current bounding radius of the object
See also:
SetBoundingRadius

XVECTOR2 gv_gameobject2d::GetCenter (  )  const

center of object, relative to height/width

Returns:
the current center of the object

XVECTOR2 gv_gameobject2d::GetScaledCenter (  )  const

center of object using scaling

Returns:
the current center of the object multiplied by the current scaling
See also:
GetCenter

void gv_gameobject2d::SetObjectType ( OBJECT_TYPE  objectType  ) 

set the object type, defined in gameglobals.h

Parameters:
objectType the new object type
The object type can be used to tell what kind of object a gv_gameobject2d is in preparation for dynamic casting or for other situations. OBJECT_TYPE is defined in gameglobals.h and is specific to the game.

OBJECT_TYPE gv_gameobject2d::GetObjectType (  )  const

get the object type

Returns:
the current object type
See also:
SetObjectType

void gv_gameobject2d::SetVelocity ( const XVECTOR2 velocity  ) 

velocity of object

Parameters:
velocity the new velocity for this object
Velocity is included in the game object definition because many game objects seem to use it. It is not a required field and is simply here for convenience.

XVECTOR2 gv_gameobject2d::GetVelocity (  )  const

get current velocity of this object

Returns:
the current velocity of this object
See also:
SetVelocity

void gv_gameobject2d::SetName ( char *  szName  ) 

name of object, helps in debugging

Parameters:
name the new name for the object
The object's name is mainly to help with debugging and does not need to be used.

char* gv_gameobject2d::GetName (  )  const

get the current name of this object

Returns:
the current name of this object
See also:
SetName


Member Data Documentation

location

Definition at line 326 of file gv_gameobject2d.h.

center

Definition at line 327 of file gv_gameobject2d.h.

float gv_gameobject2d::rotation [protected]

rotation increasing CCW

Definition at line 328 of file gv_gameobject2d.h.

size multiplier (.5 = half size, 1.0 = full size, 2.0 = float, etc)

Definition at line 329 of file gv_gameobject2d.h.

unsigned long gv_gameobject2d::modulateColor [protected]

alpha values for object (alpha, red, green, blue)

Definition at line 330 of file gv_gameobject2d.h.

float gv_gameobject2d::width [protected]

unscaled width of object

Definition at line 331 of file gv_gameobject2d.h.

float gv_gameobject2d::height [protected]

unscaled height of object

Definition at line 332 of file gv_gameobject2d.h.

bounding radius

Definition at line 333 of file gv_gameobject2d.h.

type of object (defined in enum above)

Definition at line 334 of file gv_gameobject2d.h.

current object speed

Definition at line 335 of file gv_gameobject2d.h.

char* gv_gameobject2d::name [protected]

arbitrary, helps in debugging

Definition at line 336 of file gv_gameobject2d.h.


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

Copyright(C) gvSystem & GamePlus All Rights Reserved.