DigitalSpaces::DIPhysicsBase Struct Reference
[Physics]

#include <Physics_Base.h>

Inherits DigitalSpaces::DIObjectBase.


Detailed Description

A common functionality class implemented by all Physics objects (except DIPhysics).

To access this interface, you will have to do a dss_cast/QueryInterface.

Todo:
Other physics interface should inherit from this interface. It is recommended that initialization of physics objects be performed by the SceneGraph and providing appropriate information in the .scene format. However, if creating objects manually, the process is:
This design was to simplify implementations that do not allow run-time alteration of certain properties. However as development continued, it was decided that implementations must allow alteration of properties at run time. Therefore while it is still required to call BeginSetup and EndSetup, Set can be called at any time.

See also:
DIPhysicsBody DIPhysicsShape DIPhysicsJoint

Public Member Functions

void BeginSetup ()
 Begins initialization of a newly created physics object.
void BeginSetup (const char *sObjectType)
 Begins initialization of a newly created physics object, allowing specification of an object subtype.
void EndSetup ()
 Causes actual initialization of the physics object, using the type specified in BeginSetup and the properties set by the Set functions.
void SetUserData (void *userData)
 Allows storage of an unknown peice of data for the user.
void * GetUserData ()
 Retreives a stored peice of unknown data.
Set Properties
Set Properties, overiding defaults.

If you attempt to set a property that does not exist, or attempt to set a property to an invalid data type, this is silently ignored.

void Set (const char *sSettingName, in_Vector3f *vecValue)
 Set a property to a vector value.
void Set (const char *sSettingName, in_Quaternionf *qtrValue)
 Set a property to a quaternion value.
void Set (const char *sSettingName, float fValue)
 Set a property to a floating point value.
void Set (const char *sSettingName, bool bValue)
 Set a property to a boolean value.
Get Properties
Get properties, either defaults or as set by the Set functions.

If the property does not exist, or is not the type specified, then no data (or an error indicator) will be returned.

Todo:
Add a function that supports DIVariant, to allow for returning the various types of data supported from the one function.


void GetPropertyNames (DIStringList1 *propertyList)
 Get the names of all the properties currently set on this object.
void GetVector (const char *sSettingName, out_Vector3f *vecValue)
 Retreive a property that is stored as a vector.
void GetQuaternion (const char *sSettingName, out_Quaternionf *quatValue)
 Retreive a property that is stored as a quaternion.
float GetFloat (const char *sSettingName)
 Retreive a property that is stored as a float.
bool GetBool (const char *sSettingName)
 Retreive a property that is stored as a boolean.
const char * GetName ()
 Retrieve the name of the object.

Member Function Documentation

void DigitalSpaces::DIPhysicsBase::BeginSetup (  ) 

Begins initialization of a newly created physics object.

This function is appropriate when initializing an object that doesnt support subtypes (DIPhysicsWorld, DIPhysicsBody). If you call this function on an object that does support subtypes, initialization will not occur correctly, and the results are undetermined.

Todo:
Should this function be removed and replaced with a call to BeginSetup(const char* sObjectType) where sObjectType is ignored if appropriate for the object?

void DigitalSpaces::DIPhysicsBase::BeginSetup ( const char *  sObjectType  ) 

Begins initialization of a newly created physics object, allowing specification of an object subtype.

For a list of what subtypes are supported, see DIPhysicsShape and DIPhysicsJoint. If called on an object that doesn't support subtypes, sObjectType will be ignored, as if BeginSetup() had been called. Calling with an unsupported value of sObjectType will prevent initialization occuring correctly, and will result in an undetermined state.

void DigitalSpaces::DIPhysicsBase::Set ( const char *  sSettingName,
in_Vector3f vecValue 
)

Set a property to a vector value.

Note:
Named SetVector in script binding

void DigitalSpaces::DIPhysicsBase::Set ( const char *  sSettingName,
in_Quaternionf qtrValue 
)

Set a property to a quaternion value.

Note:
Named SetQuaternion in script binding

void DigitalSpaces::DIPhysicsBase::Set ( const char *  sSettingName,
float  fValue 
)

Set a property to a floating point value.

Note:
Named SetFloat in script binding

void DigitalSpaces::DIPhysicsBase::Set ( const char *  sSettingName,
bool  bValue 
)

Set a property to a boolean value.

Note:
Named SetBool in script binding

void DigitalSpaces::DIPhysicsBase::EndSetup (  ) 

Causes actual initialization of the physics object, using the type specified in BeginSetup and the properties set by the Set functions.

void DigitalSpaces::DIPhysicsBase::SetUserData ( void *  userData  ) 

Allows storage of an unknown peice of data for the user.

Deprecated:

void* DigitalSpaces::DIPhysicsBase::GetUserData (  ) 

Retreives a stored peice of unknown data.

Deprecated:

void DigitalSpaces::DIPhysicsBase::GetPropertyNames ( DIStringList1 propertyList  ) 

Get the names of all the properties currently set on this object.

Parameters:
[out] propertyList A String List that will have the names of the available properties appended to it. The implementation does not clear the list before appending.
Note:
While this returns the names of the properties, there is currently no way to discover what type of data the properties are.

void DigitalSpaces::DIPhysicsBase::GetVector ( const char *  sSettingName,
out_Vector3f vecValue 
)

Retreive a property that is stored as a vector.

Parameters:
sSettingName The name of the property.
[out] vecValue Vector to be filled with the property value.
Note that if the property is not found, or is not a vector, then the contents of vecValue will not be changed.

void DigitalSpaces::DIPhysicsBase::GetQuaternion ( const char *  sSettingName,
out_Quaternionf quatValue 
)

Retreive a property that is stored as a quaternion.

Parameters:
sSettingName The name of the property.
[out] quatValue Quaternion to be filled with the property value.
Note that if the property is not found, or is not a quaternion, then the contents of quatValue will not be changed.

float DigitalSpaces::DIPhysicsBase::GetFloat ( const char *  sSettingName  ) 

Retreive a property that is stored as a float.

Parameters:
sSettingName The name of the property.
Returns:
The value of the property, or 0.0 if the property is not found, or is not a float.
Note:
The error condition return value is also a valid return value.

bool DigitalSpaces::DIPhysicsBase::GetBool ( const char *  sSettingName  ) 

Retreive a property that is stored as a boolean.

Parameters:
sSettingName The name of the property.
Returns:
The value of the property, or false if the property is not found, or is not a bool.
Note:
The error condition return value is also a valid return value.

const char* DigitalSpaces::DIPhysicsBase::GetName (  ) 

Retrieve the name of the object.

This is the name used when the object is created, as all physics objects have a unique name, at least to their type of object.

Returns:
The name of the object.


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

Generated on Sun Aug 31 17:46:28 2008 for Digital Spaces by  doxygen 1.5.6