|
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:
[legend]Collaboration diagram for gv_gameobject2d:
[legend]List of all members.
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 |
| 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.
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
size multiplier (.5 = half size, 1.0 = full size, 2.0 = float, etc)
Definition at line 329 of file gv_gameobject2d.h.
The documentation for this class was generated from the following file:
|