Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

Rt2dObject
[Rt2d]


Functions

Rt2dObject Rt2dObjectCopy (Rt2dObject *dst, Rt2dObject *src)
Rt2dObject Rt2dObjectSetVisible (Rt2dObject *object, RwBool visible)
RwBool  Rt2dObjectIsVisible (Rt2dObject *object)
RwMatrix Rt2dObjectGetMTM (Rt2dObject *object)
void  Rt2dObjectApplyCTM (Rt2dObject *object)
Rt2dObject Rt2dObjectSetMTM (Rt2dObject *object, RwMatrix *mtm)
RwMatrix Rt2dObjectGetLTM (Rt2dObject *object)
void  Rt2dObjectMTMChanged (Rt2dObject *object)
Rt2dObject Rt2dObjectMTMSetIdentity (Rt2dObject *object)
Rt2dObject Rt2dObjectMTMScale (Rt2dObject *object, RwReal x, RwReal y)
Rt2dObject Rt2dObjectMTMTranslate (Rt2dObject *object, RwReal x, RwReal y)
Rt2dObject Rt2dObjectMTMRotate (Rt2dObject *object, RwReal theta)
RwRGBAReal Rt2dObjectGetColorMultiplier (Rt2dObject *object)
Rt2dObject Rt2dObjectSetColorMultiplier (Rt2dObject *object, RwRGBAReal *multCol)
RwRGBAReal Rt2dObjectGetColorOffset (Rt2dObject *object)
Rt2dObject Rt2dObjectSetColorOffset (Rt2dObject *object, RwRGBAReal *oofsCol)
RwInt32  Rt2dObjectGetObjectType (Rt2dObject *object)
RwInt32  Rt2dObjectGetDepth (Rt2dObject *object)
Rt2dObject Rt2dObjectSetDepth (Rt2dObject *object, RwInt32 depth)
RwBool  Rt2dObjectIsScene (Rt2dObject *object)
RwBool  Rt2dObjectIsShape (Rt2dObject *object)
RwBool  Rt2dObjectIsPickRegion (Rt2dObject *object)
RwBool  Rt2dObjectIsObjectString (Rt2dObject *object)

Detailed Description

Objects

Rt2dObject Overview

An object is either a shape, scene, pick regions or object string. Objects work by manipulate transformation matrices.

There are 3 transformation matrices used:

Manipulating Objects in a Scene
  1. Rt2dSceneUnlock unlocks the scene.
  2. Rt2dSceneGetChildByIndex obtains a pointer to an object or Rt2dSceneForAllChildren obtains pointers to all objects.
  3. Manipulate objects and object colors using Rt2dObject functions.
  4. Rt2dObjectApplyCTM copies the current transformation matrix (CTM) to the object modeling transformation matrix (MTM). This is necessary to apply camera changes i.e. changing the viewpoint.
  5. Rt2dSceneUpdateLTM updates the LTM because the scene MTM has changed and may need to be recalculated for rendering. If the LTM does not need updating, for example for collision detection, you can wait until rendering because the rendering functions update the LTM.
  6. Rt2dSceneSetDepthDirty tells the scene the next time it renders the depth may have changed. This function is required if Rt2dObjectSetDepth has manipulated an object.
See also:
Rt2dSceneCreate , Rt2dObjectStringCreate , Rt2dPickRegionCreate , Rt2dShapeCreate ,

Function Documentation

void Rt2dObjectApplyCTM Rt2dObject   object
 

Rt2dObjectApplyCTM applies the current CTM to the object MTM.

Parameters:
object  Pointer to the object to use.
Returns:
NULL.
See also:
Rt2dObjectGetLTM , Rt2dObjectGetMTM , Rt2dObjectSetMTM , Rt2dObjectMTMChanged , Rt2dCTMPush , Rt2dCTMPop , Rt2dCTMSetIdentity , Rt2dCTMScale , Rt2dCTMTranslate , Rt2dCTMRotate
Rt2dObject* Rt2dObjectCopy Rt2dObject   dst,
Rt2dObject   src
 

Rt2dObjectCopy copies an object to another one. If the object is a scene, the scene should be unlocked before copying.

Parameters:
dst  Pointer to the destination memory to copy the object toobject.
src  Pointer to the source object.
Returns:
Returns the destination object if successful; NULL otherwise.
See also:
Rt2dObjectStringCreate , Rt2dPickRegionCreate , Rt2dSceneCreate , Rt2dShapeCreate , Rt2dSceneUnlock
RwRGBAReal* Rt2dObjectGetColorMultiplier Rt2dObject   object
 

Rt2dObjectGetColorMultiplier gets the color multiplier of this object (relative to the parent object). The floating point value should be between 0 and 1.

Parameters:
object  Pointer to the object to use.
Returns:
Returns the color multiplier of the object.
See also:
Rt2dObjectSetColorMultiplier
RwRGBAReal* Rt2dObjectGetColorOffset Rt2dObject   object
 

Rt2dObjectGetColorOffset gets the color offset in use (relative to the parent). The floating point value should be between 0 and 1.

Parameters:
object  Pointer to the object to use.
Returns:
Returns the color offset of the object.
See also:
Rt2dObjectSetColorOffset
RwInt32 Rt2dObjectGetDepth Rt2dObject   object
 

Rt2dObjectGetDepth gets the z-order of the object.

Parameters:
object  Pointer to the object to use.
Returns:
Returns the z-order of the object.
See also:
Rt2dObjectSetDepth
RwMatrix* Rt2dObjectGetLTM Rt2dObject   object
 

Rt2dObjectGetLTM gets the LTM for positioning the object.

Parameters:
object  Pointer to the object to use.
Returns:
Returns the LTM.
See also:
Rt2dObjectSetMTM , Rt2dObjectGetMTM , Rt2dObjectMTMChanged
RwMatrix* Rt2dObjectGetMTM Rt2dObject   object
 

Rt2dObjectGetMTM gets the MTM for positioning the object.

Parameters:
object  Pointer to the object to use.
Returns:
Returns the MTM relative to the object's parent.
See also:
Rt2dObjectSetMTM , Rt2dObjectMTMChanged , Rt2dObjectGetLTM
RwInt32 Rt2dObjectGetObjectType Rt2dObject   object
 

Rt2dObjectGetObjectType gets the internal object type.

Parameters:
object  Pointer to the object to use.
Returns:
Returns the object type.
See also:
Rt2dObjectTypeEnum
RwBool Rt2dObjectIsObjectString Rt2dObject   object
 

Rt2dObjectIsObjectString tests if a 2d object is an Object String.

Parameters:
object  Pointer to the object to use.
Returns:
Returns TRUE if the object is an ObjectString.
See also:
Rt2dObjectIsScene , Rt2dObjectIsShape , Rt2dObjectIsPickRegion
RwBool Rt2dObjectIsPickRegion Rt2dObject   object
 

Rt2dObjectIsPickRegion tests if a 2d object is a Pick Region.

Parameters:
object  Pointer to the object to use.
Returns:
Returns TRUE if the object is a Pick Region.
See also:
Rt2dObjectIsScene , Rt2dObjectIsShape , Rt2dObjectIsObjectString
RwBool Rt2dObjectIsScene Rt2dObject   object
 

Rt2dObjectIsScene tests if a 2d object is a Scene.

Parameters:
object  Pointer to the object to use.
Returns:
Returns TRUE if the object is a Scene.
See also:
Rt2dObjectIsShape , Rt2dObjectIsObjectString , Rt2dObjectIsPickRegion
RwBool Rt2dObjectIsShape Rt2dObject   object
 

Rt2dObjectIsShape tests if 2d object is a Shape.

Parameters:
object  Pointer to the object to use.
Returns:
Returns TRUE if the object is a Shape.
See also:
Rt2dObjectIsScene , Rt2dObjectIsObjectString , Rt2dObjectIsPickRegion
RwBool Rt2dObjectIsVisible Rt2dObject   object
 

Rt2dObjectIsVisible checks if the object will be rendered.

Parameters:
object  Pointer to the object to check.
Returns:
TRUE if visible; FALSE otherwise.
See also:
Rt2dObjectSetVisible
void Rt2dObjectMTMChanged Rt2dObject   object
 

Rt2dObjectMTMChanged warns the object that the MTM matrix has been changed (using Rt2dObjectGetMTM) and that the LTM might need to be recalculated.

Parameters:
object  Pointer to the object to use.
Returns:
NULL
See also:
Rt2dObjectSetMTM , Rt2dObjectGetMTM , Rt2dObjectGetLTM
Rt2dObject* Rt2dObjectMTMRotate Rt2dObject   object,
RwReal    theta
 

Rt2dObjectMTMRotate is used to apply a rotation to the current MTM using the specified angle of rotation. A rotation in an anticlockwise direction are achieved using a positive angle. Note that the rotation is preconcatenated with the MTM.

Parameters:
object  Pointer to the object to use.
theta  A RwReal value equal to the angle of rotation in degrees.
Returns:
Returns the object pointer on success.
See also:
Rt2dObjectGetMTM , Rt2dObjectSetMTM , Rt2dObjectApplyCTM , Rt2dObjectMTMSetIdentity , Rt2dObjectMTMScale , Rt2dObjectMTMTranslate
Rt2dObject* Rt2dObjectMTMScale Rt2dObject   object,
RwReal    x,
RwReal    y
 

Rt2dObjectMTMScale is used to apply a scale transformation to the object's MTM using the specified x- and y-scale factors. Note that the scale is preconcatenated with the MTM.

Parameters:
object  Pointer to the object to use.
x  A RwReal value equal to the scale factor in the x-direction.
y  A RwReal value equal to the scale factor in the y-direction.
Returns:
Returns the object pointer on success.
See also:
Rt2dObjectMTMChanged , Rt2dObjectGetLTM , Rt2dObjectGetMTM , Rt2dObjectSetMTM , Rt2dObjectApplyCTM , Rt2dObjectMTMSetIdentity , Rt2dObjectMTMTranslate , Rt2dObjectMTMRotate
Rt2dObject* Rt2dObjectMTMSetIdentity Rt2dObject   object
 

Rt2dObjectMTMSetIdentity is used to set the object MTM equal to the identity matrix. This procedure removes all previously applied transformations.

Parameters:
object  Pointer to the object to use.
Returns:
Returns the object pointer on success.
See also:
Rt2dObjectMTMChanged , Rt2dObjectGetLTM , Rt2dObjectGetMTM , Rt2dObjectSetMTM , Rt2dObjectApplyCTM , Rt2dObjectMTMScale , Rt2dObjectMTMTranslate , Rt2dObjectMTMRotate
Rt2dObject* Rt2dObjectMTMTranslate Rt2dObject   object,
RwReal    x,
RwReal    y
 

Rt2dObjectMTMTranslate is used to apply a translation to the MTM using the specified x- and y-components. Note that the translation is preconcatenated with the MTM.

Parameters:
object  Pointer to the object to use.
x  A RwReal value equal to the translation in the x-direction.
y  A RwReal value equal to the translation in the y-direction.
Returns:
Returns the object pointer on success.
See also:
Rt2dObjectMTMChanged , Rt2dObjectGetLTM , Rt2dObjectGetMTM , Rt2dObjectSetMTM , Rt2dObjectApplyCTM , Rt2dObjectMTMSetIdentity , Rt2dObjectMTMScale , Rt2dObjectMTMRotate
Rt2dObject* Rt2dObjectSetColorMultiplier Rt2dObject   object,
RwRGBAReal   multCol
 

Rt2dObjectSetColorMultiplier sets the color multiplier of the object (relative to the parent object). The floating point value should be between 0 and 1.

Parameters:
object  Pointer to the object to use.
multCol  Pointer to an RwRGBAReal color to use.
Returns:
Returns the 2dObject if successful or NULL if there is error.
See also:
Rt2dObjectGetColorMultiplier
Rt2dObject* Rt2dObjectSetColorOffset Rt2dObject   object,
RwRGBAReal   oofsCol
 

Rt2dObjectSetColorOffset sets the color offset in use (relative to the parent). The floating point value should be between 0 and 1.

Parameters:
object  Pointer to the object to use.
oofsCol  Pointer to the RwRGBAReal color to use.
Returns:
Returns the 2dObject if successful or NULL if there is error.
See also:
Rt2dObjectGetColorOffset
Rt2dObject* Rt2dObjectSetDepth Rt2dObject   object,
RwInt32    depth
 

Rt2dObjectSetDepth sets the z-order of the object.

Parameters:
object  Pointer to the object to use.
depth  New depth of the object.
Returns:
Returns the 2dObject if successful or NULL if there is error.
See also:
Rt2dObjectGetDepth
Rt2dObject* Rt2dObjectSetMTM Rt2dObject   object,
RwMatrix   mtm
 

Rt2dObjectSetMTM sets the MTM for positioning the object (relative to the parent).

Parameters:
object  Pointer to the object to use.
mtm  Positioning matrix relative to the parent.
Returns:
Returns the 2dObject if successful or NULL if there is error.
See also:
Rt2dObjectGetMTM , Rt2dObjectMTMChanged , Rt2dObjectGetLTM
Rt2dObject* Rt2dObjectSetVisible Rt2dObject   object,
RwBool    isVisible
 

Rt2dObjectSetVisible sets whether or not the object is rendered.

Parameters:
object  Pointer to the object to use.
isVisible  TRUE if object should be rendered.
Returns:
Returns the 2dObject if successful or NULL if there is error.
See also:
Rt2dObjectIsVisible

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:48 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)