A3DL::Object3D Class Reference
[libmetaobject_a3dl]
#include <vos/metaobjects/a3dl/object3d.hh>
Inheritance diagram for A3DL::Object3D:

Detailed Description
Base class for all 3D objects.Provides properties for position, orientation and scaling (size) of the object, as well as material.
Definition at line 43 of file object3d.hh.
Public Member Functions
- Object3D (VOS::VobjectBase *superobject)
- virtual ~Object3D ()
- virtual void initialize ()
- virtual void setPosition (double x, double y, double z)
- virtual void setOrientation (double x, double y, double z, double phi)
- virtual void setOrientationWithQuaternion (double x, double y, double z, double phi)
- virtual void setScaling (double x, double y, double z)
- virtual void getPosition (double &x, double &y, double &z)
- virtual void getOrientation (double &x, double &y, double &z, double &phi)
- virtual void getOrientationAsQuaternion (double &x, double &y, double &z, double &phi)
- virtual void getScaling (double &x, double &y, double &z)
- virtual VUtil::vRef< Material > getMaterial (bool createIfNone=true)
- virtual void setMaterial (Material *obj)
- virtual MaterialIterator getMaterials ()
- virtual void setPositionHT (double x, double y, double z)
- virtual void setOrientationHT (double x, double y, double z, double phi)
- virtual void setOrientationWithQuaternionHT (double x, double y, double z, double phi)
- virtual void setScalingHT (double x, double y, double z)
- virtual void getPositionHT (double &x, double &y, double &z)
- virtual void getOrientationHT (double &x, double &y, double &z, double &phi)
- virtual void getOrientationAsQuaternionHT (double &x, double &y, double &z, double &phi)
- virtual void getScalingHT (double &x, double &y, double &z)
- virtual const std::string getVOSType ()
- void setOrInsertChild (const std::string &name, VOS::Vobject *obj)
- virtual bool supportsPhysics ()
- virtual void applyForce (double x, double y, double z)
- virtual void applyTorque (double x, double y, double z)
- virtual void getLinearVelocity (double &x, double &y, double &z)
- virtual void getAngularVelocity (double &x, double &y, double &z)
- virtual VUtil::vRef< VOS::Property > getPositionObj ()
- virtual void setPositionObj (VOS::Property *obj)
- virtual VUtil::vRef< VOS::Property > getOrientationObj ()
- virtual void setOrientationObj (VOS::Property *obj)
- virtual VUtil::vRef< VOS::Property > getScalingObj ()
- virtual void setScalingObj (VOS::Property *obj)
- virtual void moveTo (double x, double y, double z, double timestep)
Static Public Member Functions
- static VOS::MetaObject * new_Object3D (VOS::VobjectBase *superobject, const std::string &type)
- static void setThreeFloatProperty (Vobject &vob, const std::string &name, double x, double y, double z)
- static void getThreeFloatProperty (Vobject &vob, const std::string &name, double *x, double *y, double *z)
Constructor & Destructor Documentation
| A3DL::Object3D::Object3D | ( | VOS::VobjectBase * | superobject | ) |
| virtual A3DL::Object3D::~Object3D | ( | ) | [virtual] |
Member Function Documentation
| virtual void A3DL::Object3D::applyForce | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [virtual] |
Apply an instantaneous linear force vector to this object.
- Parameters:
-
x component of vector y component of vector z component of vector
Reimplemented in csMetaObject3D.
| virtual void A3DL::Object3D::applyTorque | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [virtual] |
Apply an instantaneous angular torque to this object.
The direction of the vector specifies the axis, the length of the vector specifies the magnitude, and the direction of rotation is determined by the "right hand" rule.
- Parameters:
-
x component of vector y component of vector z component of vector
Reimplemented in csMetaObject3D.
| virtual void A3DL::Object3D::getAngularVelocity | ( | double & | x, | |
| double & | y, | |||
| double & | z | |||
| ) | [virtual] |
Fetch the current angular velocity of this object.
The direction of the vector specifies the axis, the length of the vector specifies the magnitude, and the direction of rotation is determined by the "right hand" rule.
- Parameters:
-
x component of vector y component of vector z component of vector
Reimplemented in csMetaObject3D.
| virtual void A3DL::Object3D::getLinearVelocity | ( | double & | x, | |
| double & | y, | |||
| double & | z | |||
| ) | [virtual] |
Fetch the current linear velocity vector for this object.
- Parameters:
-
x component of vector y component of vector z component of vector
Reimplemented in csMetaObject3D.
| virtual VUtil::vRef<Material> A3DL::Object3D::getMaterial | ( | bool | createIfNone = true |
) | [virtual] |
Get material vobject.
| virtual MaterialIterator A3DL::Object3D::getMaterials | ( | ) | [virtual] |
Get all attached material objects.
| virtual void A3DL::Object3D::getOrientation | ( | double & | x, | |
| double & | y, | |||
| double & | z, | |||
| double & | phi | |||
| ) | [virtual] |
Get the orientation of this 3D object in axis-angle rotation.
See setOrientation() for details.
- Note:
- This can be easily converted into a quaternion with the following math:
quat.r = cos(phi/2.0); quat.x = x * sin(phi/2.0); quat.y = y * sin(phi/2.0); quat.z = z * sin(phi/2.0);
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::getOrientationAsQuaternion | ( | double & | x, | |
| double & | y, | |||
| double & | z, | |||
| double & | phi | |||
| ) | [virtual] |
Convenience function to get the orientation of this 3D object as a quaternion, converting from A3DL's axis-angle representation.
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::getOrientationAsQuaternionHT | ( | double & | x, | |
| double & | y, | |||
| double & | z, | |||
| double & | phi | |||
| ) | [virtual] |
Convenience function to get the hard transform (HT) orientation of this 3D object as a quaternion, converting from A3DL's axis-angle representation.
This transform is applied against the object before the normal orientation transform is applied and is not affected by hierarchical transforms.
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::getOrientationHT | ( | double & | x, | |
| double & | y, | |||
| double & | z, | |||
| double & | phi | |||
| ) | [virtual] |
Get the hard transform (HT) orientation of this 3D object in axis-angle rotation.
See setOrientation() for details. This transform is applied against the object before the normal orientation transform is applied and is not affected by hierarchical transforms.
- Note:
- This can be easily converted into a quaternion with the following math:
quat.r = cos(phi/2.0); quat.x = x * sin(phi/2.0); quat.y = y * sin(phi/2.0); quat.z = z * sin(phi/2.0);
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| virtual VUtil::vRef<VOS::Property> A3DL::Object3D::getOrientationObj | ( | ) | [virtual] |
| virtual void A3DL::Object3D::getPosition | ( | double & | x, | |
| double & | y, | |||
| double & | z | |||
| ) | [virtual] |
Get position of this 3D object.
- Parameters:
-
x X translation, relative to origin of parent object y Y translation, relative to origin of parent object z Z translation, relative to origin of parent object
- Exceptions:
-
NoSuchObjectError if "position" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::getPositionHT | ( | double & | x, | |
| double & | y, | |||
| double & | z | |||
| ) | [virtual] |
Get the hard transform (HT) position of this 3D object.
This transform is applied against the object before the normal position transform is applied and is not affected by hierarchical transforms.
- Parameters:
-
x X translation, relative to origin of parent object y Y translation, relative to origin of parent object z Z translation, relative to origin of parent object
- Exceptions:
-
NoSuchObjectError if "position" subobject does not exist, or is not a property.
| virtual VUtil::vRef<VOS::Property> A3DL::Object3D::getPositionObj | ( | ) | [virtual] |
Get position property object.
| virtual void A3DL::Object3D::getScaling | ( | double & | x, | |
| double & | y, | |||
| double & | z | |||
| ) | [virtual] |
Get scaling factors of this 3D object.
- Parameters:
-
x X scaling y Y scaling z Z scaling
- Exceptions:
-
NoSuchObjectError if "scaling" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::getScalingHT | ( | double & | x, | |
| double & | y, | |||
| double & | z | |||
| ) | [virtual] |
Get the hard transform (HT) scaling of this 3D object.
This transform is applied against the object before the normal scaling transform is applied and is not affected by hierarchical transforms.
- Parameters:
-
x X scaling y Y scaling z Z scaling
- Exceptions:
-
NoSuchObjectError if "scaling" subobject does not exist, or is not a property.
| virtual VUtil::vRef<VOS::Property> A3DL::Object3D::getScalingObj | ( | ) | [virtual] |
| static void A3DL::Object3D::getThreeFloatProperty | ( | Vobject & | vob, | |
| const std::string & | name, | |||
| double * | x, | |||
| double * | y, | |||
| double * | z | |||
| ) | [static] |
| virtual const std::string A3DL::Object3D::getVOSType | ( | ) | [virtual] |
- Returns:
- the specific VOS type name that represents the VOS interface this object is supplying. This should always be overridden by the subclass.
Reimplemented from VOS::MetaObject.
Reimplemented in A3DL::Billboard, A3DL::Clone, A3DL::Cone, A3DL::Cube, A3DL::Cylinder, A3DL::Model, A3DL::PolygonMesh, A3DL::Snow, and A3DL::Sphere.
| virtual void A3DL::Object3D::initialize | ( | ) | [virtual] |
Initialize this object to have no property access control, position (0,0,0), orientation (0,1,0,0) and scaling(1,1,1).
| virtual void A3DL::Object3D::moveTo | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double | timestep | |||
| ) | [virtual] |
Reimplemented in csMetaObject3D.
| static VOS::MetaObject* A3DL::Object3D::new_Object3D | ( | VOS::VobjectBase * | superobject, | |
| const std::string & | type | |||
| ) | [static] |
| virtual void A3DL::Object3D::setMaterial | ( | Material * | obj | ) | [virtual] |
Set a material vobject.
| virtual void A3DL::Object3D::setOrientation | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double | phi | |||
| ) | [virtual] |
Set the orientation of this 3D object in axis-angle rotation.
The first three parameters are a unit vector in world space which define an axis, the fourth parameter is a clockwise rotation about that axis. For example, [0 1 0 20] would specify a rotation of 20 degrees around a vector pointing straight up.
- Note:
- You can convert a quaternion into angle-axis rotation with the following math:
phi = 2.0 * acos(quat.r); x = quat.x / sin(phi/2.0); y = quat.y / sin(phi/2.0); z = quat.z / sin(phi/2.0);
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::setOrientationHT | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double | phi | |||
| ) | [virtual] |
Set the hard transform (HT) orientation of this 3D object in axis-angle rotation.
This transform is applied against the object before the normal orientation transform is applied and is not affected by hierarchical transforms. The first three parameters are a unit vector in world space which define an axis, the fourth parameter is a clockwise rotation about that axis. For example, [0 1 0 20] would specify a rotation of 20 degrees around a vector pointing straight up.
- Note:
- You can convert a quaternion into angle-axis rotation with the following math:
phi = 2.0 * acos(quat.r); x = quat.x / sin(phi/2.0); y = quat.y / sin(phi/2.0); z = quat.z / sin(phi/2.0);
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::setOrientationObj | ( | VOS::Property * | obj | ) | [virtual] |
| virtual void A3DL::Object3D::setOrientationWithQuaternion | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double | phi | |||
| ) | [virtual] |
Convenience function to set the orientation of this 3D object using a quaternion, which is then converted to A3DL's axis-angle notation.
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::setOrientationWithQuaternionHT | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double | phi | |||
| ) | [virtual] |
Convenience function to set the hard transform (HT) orientation of this 3D object using a quaternion, which is then converted to A3DL's axis-angle notation.
This transform is applied against the object before the normal orientation transform is applied and is not affected by hierarchical transforms.
- Parameters:
-
x X vector component y Y vector component z Z vector component phi the rotation about the vector axis, in degrees
- Exceptions:
-
NoSuchObjectError if "orientation" subobject does not exist, or is not a property.
| void A3DL::Object3D::setOrInsertChild | ( | const std::string & | name, | |
| VOS::Vobject * | obj | |||
| ) |
| virtual void A3DL::Object3D::setPosition | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [virtual] |
Set position of this 3D object.
- Parameters:
-
x X translation, relative to origin of parent object y Y translation, relative to origin of parent object z Z translation, relative to origin of parent object
- Exceptions:
-
NoSuchObjectError if "position" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::setPositionHT | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [virtual] |
Set the hard transform (HT) position of this 3D object.
This transform is applied against the object before the normal position transform is applied and is not affected by hierarchical transforms.
- Parameters:
-
x X translation, relative to origin of parent object y Y translation, relative to origin of parent object z Z translation, relative to origin of parent object
- Exceptions:
-
NoSuchObjectError if "position" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::setPositionObj | ( | VOS::Property * | obj | ) | [virtual] |
Set position property object.
| virtual void A3DL::Object3D::setScaling | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [virtual] |
Set scaling factors of this 3D object.
- Parameters:
-
x X scaling y Y scaling z Z scaling
- Exceptions:
-
NoSuchObjectError if "scaling" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::setScalingHT | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [virtual] |
Set the hard transform (HT) scaling this 3D object.
This transform is applied against the object before the normal scaling transform is applied and is not affected by hierarchical transforms.
- Parameters:
-
x X scaling y Y scaling z Z scaling
- Exceptions:
-
NoSuchObjectError if "scaling" subobject does not exist, or is not a property.
| virtual void A3DL::Object3D::setScalingObj | ( | VOS::Property * | obj | ) | [virtual] |
| static void A3DL::Object3D::setThreeFloatProperty | ( | Vobject & | vob, | |
| const std::string & | name, | |||
| double | x, | |||
| double | y, | |||
| double | z | |||
| ) | [static] |
Utility functions for getting/setting properties.
| virtual bool A3DL::Object3D::supportsPhysics | ( | ) | [virtual] |
- Returns:
- If true, applyForce/applyTorque will be fed into a physics engine and the object will have dynamic response. If false applyForce/applyTorque apply the change directly as a delta to the position/orientation property.
Reimplemented in csMetaObject3D.
The documentation for this class was generated from the following file:
- /home/tetron/hack/vos/libs/vos/metaobjects/a3dl/object3d.hh