00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Side Effects Software Inc. 00008 * 477 Richmond Street West, Suite 1001 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 */ 00013 00014 #ifndef __SIM_Motion_h__ 00015 #define __SIM_Motion_h__ 00016 00017 #include "SIM_API.h" 00018 #include <UT/UT_Vector3.h> 00019 #include <UT/UT_Quaternion.h> 00020 #include <UT/UT_Matrix4.h> 00021 #include "SIM_PositionSimple.h" 00022 00023 /// This is the default implementation for standard motion data. 00024 class SIM_API SIM_Motion : public SIM_PositionSimple 00025 { 00026 public: 00027 /// Control the linear velocity attribute of this data. 00028 GETSET_DATA_FUNCS_V3(SIM_NAME_VELOCITY, Velocity); 00029 /// Control the angular velocity attribute of this data. 00030 /// This is specified in degrees per second. 00031 GETSET_DATA_FUNCS_V3(SIM_NAME_ANGVELOCITY, AngularVelocityDegrees); 00032 00033 /// These are the access functions that transform our values in 00034 /// radians that we use internally everywhere into the actual data 00035 /// values that are stored in degrees. 00036 void setAngularVelocity(const UT_Vector3 &value) 00037 { 00038 UT_Vector3 deg; 00039 deg = value; 00040 deg.radToDeg(); 00041 setAngularVelocityDegrees(deg); 00042 } 00043 00044 const UT_Vector3 getAngularVelocity() const 00045 { 00046 UT_Vector3 rad; 00047 00048 rad = getAngularVelocityDegrees(); 00049 rad.degToRad(); 00050 return rad; 00051 } 00052 00053 /// Gets the motion of a point that is offset from our centre of motion. 00054 const UT_Vector3 getVelocityAtPosition(const UT_Vector3 &pos, 00055 fpreal integrateovertime = 0.0) const; 00056 00057 /// Determines the maximum velocity inside a sphere of the given 00058 /// radius. 00059 const UT_Vector3 getMaximumVelocity(fpreal radius) const; 00060 00061 protected: 00062 explicit SIM_Motion(const SIM_DataFactory *factory); 00063 virtual ~SIM_Motion(); 00064 00065 private: 00066 static const SIM_DopDescription *getMotionDopDescription(); 00067 00068 DECLARE_STANDARD_GETCASTTOTYPE(); 00069 DECLARE_DATAFACTORY(SIM_Motion, 00070 SIM_PositionSimple, 00071 "Motion", 00072 getMotionDopDescription()); 00073 }; 00074 00075 #endif 00076
1.5.9