SIM_ForceField Class Reference

#include <SIM_ForceField.h>

Inheritance diagram for SIM_ForceField:

SIM_Force SIM_OptionsUser SIM_Data

List of all members.

Public Member Functions

 GETSET_DATA_FUNCS_S (SIM_NAME_FORCEATTRIBNAME, ForceAttribName)
 The name of the point attribute holding the force values.
 GETSET_DATA_FUNCS_F (SIM_NAME_FORCESCALE, ForceScale)
 Scale the calculated force value.
 GETSET_DATA_FUNCS_S (SIM_NAME_TORQUEATTRIBNAME, TorqueAttribName)
 The name of the point attribute holding the torque values.
 GETSET_DATA_FUNCS_F (SIM_NAME_TORQUESCALE, TorqueScale)
 Scale the calculated torque value.
 GETSET_DATA_FUNCS_B (SIM_NAME_USEMAXDISTANCE, UseMaxDistance)
 Determines whether or not there is a maximum distance to check.
 GETSET_DATA_FUNCS_F (SIM_NAME_MAXDISTANCE, MaxDistance)
 The maximum distance we are allowed to search for a point.
 GETSET_DATA_FUNCS_B (SIM_NAME_TREATASWIND, TreatAsWind)
 Whether to treat the force as a wind or a force.
 GETSET_DATA_FUNCS_I (SIM_NAME_SAMPLEMODE, SampleMode)
 Whether to sample by point, circle, or sphere.

Protected Member Functions

 SIM_ForceField (const SIM_DataFactory *factory)
virtual ~SIM_ForceField ()
virtual void getForceSubclass (const SIM_Object &object, const UT_Vector3 &position, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const
virtual SIM_ForceResolvergetForceResolverSubclass (const SIM_Object &object) const
virtual void getForceOnCircleSubclass (const SIM_Object &object, const UT_Vector3 &position, const UT_Vector3 &normal, const fpreal radius, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const
virtual void getForceJacobianSubclass (const SIM_Object &object, const UT_Vector3 &position, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Matrix &dFdX, UT_Matrix &dFdV) const
virtual SIM_ForceSample getOptimalForceSamplingSubclass () const
 We want to use area sampling if treat as wind is on.
virtual SIM_GuidecreateGuideObjectSubclass () const
virtual void buildGuideGeometrySubclass (const SIM_RootData &root, const SIM_Options &options, const GU_DetailHandle &gdh, UT_DMatrix4 *xform, const SIM_Time &t) const

Friends

class SIM_ForceResolverField


Detailed Description

This is an implementation of the SIM_Force interface. This implementation calculates the interpolated value from a point cloud with force and torque attributes attached to it.

Definition at line 24 of file SIM_ForceField.h.


Constructor & Destructor Documentation

SIM_ForceField::SIM_ForceField ( const SIM_DataFactory factory  )  [explicit, protected]

virtual SIM_ForceField::~SIM_ForceField (  )  [protected, virtual]


Member Function Documentation

virtual void SIM_ForceField::buildGuideGeometrySubclass ( const SIM_RootData root,
const SIM_Options options,
const GU_DetailHandle gdh,
UT_DMatrix4 xform,
const SIM_Time t 
) const [protected, virtual]

Build guide geometry by copying the points from the source geometry, and adding lines to represent the force and torque vectors.

Reimplemented from SIM_Data.

virtual SIM_Guide* SIM_ForceField::createGuideObjectSubclass (  )  const [protected, virtual]

Override this to return a SIM_GuideShared so we only have to draw our guide geometry once regardless of how many objects we are attached to.

Reimplemented from SIM_Data.

virtual void SIM_ForceField::getForceJacobianSubclass ( const SIM_Object object,
const UT_Vector3 position,
const UT_Vector3 velocity,
const UT_Vector3 angvel,
const fpreal  mass,
UT_Matrix dFdX,
UT_Matrix dFdV 
) const [protected, virtual]

Returns the derivatives of force & torque with respect to position and velocity. The jacobians are 6x6 matrices indexed from 1 (ie, dFdX(1,1) is first element). The default behaviour is to return 0 matrices. Note that the matrices are already initialized to 0 when this is called.

Reimplemented from SIM_Force.

virtual void SIM_ForceField::getForceOnCircleSubclass ( const SIM_Object object,
const UT_Vector3 position,
const UT_Vector3 normal,
const fpreal  radius,
const UT_Vector3 velocity,
const UT_Vector3 angvel,
const fpreal  mass,
UT_Vector3 force,
UT_Vector3 torque 
) const [protected, virtual]

Returns the force and torque applied by this force to a circle. The outputs may be modified according to the information passed in about the object to which the force is being applied. The default implementation calls getForce() and assumes this is the force on a unit area. So the force and torque are then scaled by the area of the circle.

Reimplemented from SIM_Force.

virtual SIM_ForceResolver* SIM_ForceField::getForceResolverSubclass ( const SIM_Object object  )  const [protected, virtual]

Creates a force resolver to evaluate this force in a threadsafe manner.

Reimplemented from SIM_Force.

virtual void SIM_ForceField::getForceSubclass ( const SIM_Object object,
const UT_Vector3 position,
const UT_Vector3 velocity,
const UT_Vector3 angvel,
const fpreal  mass,
UT_Vector3 force,
UT_Vector3 torque 
) const [protected, virtual]

Returns the force and torque on a point. The returned values are exact copies of the force and torque attributes. The getForceOnCircleSubclass() and getForceOnSphereSubclass() functions use the default implementations which scale the point force by the area or volume of the circle or sphere. This means that regardless of the size of samples used to quantize an object, the total force on the object should remain roughly constant.

Reimplemented from SIM_Force.

virtual SIM_ForceSample SIM_ForceField::getOptimalForceSamplingSubclass (  )  const [protected, virtual]

We want to use area sampling if treat as wind is on.

Reimplemented from SIM_Force.

SIM_ForceField::GETSET_DATA_FUNCS_B ( SIM_NAME_TREATASWIND  ,
TreatAsWind   
)

Whether to treat the force as a wind or a force.

SIM_ForceField::GETSET_DATA_FUNCS_B ( SIM_NAME_USEMAXDISTANCE  ,
UseMaxDistance   
)

Determines whether or not there is a maximum distance to check.

SIM_ForceField::GETSET_DATA_FUNCS_F ( SIM_NAME_MAXDISTANCE  ,
MaxDistance   
)

The maximum distance we are allowed to search for a point.

SIM_ForceField::GETSET_DATA_FUNCS_F ( SIM_NAME_TORQUESCALE  ,
TorqueScale   
)

Scale the calculated torque value.

SIM_ForceField::GETSET_DATA_FUNCS_F ( SIM_NAME_FORCESCALE  ,
ForceScale   
)

Scale the calculated force value.

SIM_ForceField::GETSET_DATA_FUNCS_I ( SIM_NAME_SAMPLEMODE  ,
SampleMode   
)

Whether to sample by point, circle, or sphere.

SIM_ForceField::GETSET_DATA_FUNCS_S ( SIM_NAME_TORQUEATTRIBNAME  ,
TorqueAttribName   
)

The name of the point attribute holding the torque values.

SIM_ForceField::GETSET_DATA_FUNCS_S ( SIM_NAME_FORCEATTRIBNAME  ,
ForceAttribName   
)

The name of the point attribute holding the force values.


Friends And Related Function Documentation

friend class SIM_ForceResolverField [friend]

Definition at line 121 of file SIM_ForceField.h.


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

Generated on Fri May 25 00:10:40 2012 for HDK by  doxygen 1.5.9