36 using namespace HDK_Sample;
59 SIM_ForceOrbit::getForceOrbitDopDescription()
87 theDopDescription.setGuideTemplates(theGuideTemplates);
88 theDopDescription.setDefaultUniqueDataName(1);
90 return &theDopDescription;
117 #if defined(HOUDINI_11)
128 for(
int axis = 0; axis < 3; ++axis)
141 #if defined(HOUDINI_11)
159 xform->
scale(scale, scale, scale);
177 UT_Vector3 pointposition = getPointPosition();
184 distancesquared =
distance2(position, pointposition);
188 force *= (mass * getPointMass()) / distancesquared;
#define SIM_NAME_SHOWGUIDE
bool getOptionB(const UT_StringRef &name) const
#define SIM_FORCES_DATANAME
GU_Detail * getGdp() const
SIM_Guide * createGuideObjectSubclass() const override
void getForceOnSphereSubclass(const SIM_Object &object, const UT_Vector3 &position, const fpreal radius, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const override
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 override
#define IMPLEMENT_DATAFACTORY(DataClass)
SIM_API const UT_StringHolder torque
fpreal64 distance2(const UT_VectorD &v1, const UT_VectorD &v2)
Distance squared (L2) aka quadrance.
constexpr SYS_FORCE_INLINE T & z() noexcept
GA_Attribute * addDiffuseAttribute(GA_AttributeOwner who, GA_Storage s=GA_STORE_INVALID)
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 override
const UT_Vector3D & getOptionV3(const UT_StringRef &name) const
**But if you need a or simply need to know when the task has note that the like this
PRM_API const PRM_Type PRM_XYZ_J
#define SIM_NAME_POINTMASS
PRM_API const PRM_Type PRM_RGB_J
void initializeSIM(void *)
GA_API const UT_StringHolder scale
SYS_FORCE_INLINE GA_Offset appendPointBlock(GA_Size npoints)
Append new points, returning the first offset of the contiguous block.
GA_Size appendVertex(GA_Offset ptoff) override
void buildGuideGeometrySubclass(const SIM_RootData &root, const SIM_Options &options, const GU_DetailHandle &gdh, UT_DMatrix4 *xform, const SIM_Time &t) const override
We override this method to create the attractor geometry.
void identity()
Set the matrix to identity.
SIM_ForceOrbit(const SIM_DataFactory *factory)
PRM_API const PRM_Type PRM_FLT_J
void applyNoise(const UT_Vector3 &pos, UT_Vector3 &forceortorque) const
bool SYSequalZero(const UT_Vector3T< T > &v)
void scale(T sx, T sy, T sz, T sw=1)
GA_API const UT_StringHolder mass
PRM_API PRM_Default PRMoneDefaults[]
SYS_FORCE_INLINE void setPos3(GA_Offset ptoff, const UT_Vector3 &pos)
Set P from a UT_Vector3.
SIM_API const UT_StringHolder force
bool hasOption(const UT_StringRef &name) const
void translate(T dx, T dy, T dz=0)
SYS_FORCE_INLINE GEO_Primitive * appendPrimitive(const GA_PrimitiveTypeId &type)
SIM_API const UT_StringHolder position
SYS_FORCE_INLINE GA_Offset getMapOffset() const
Gets the offset of this primitive in the detail containing it.
PRM_API const PRM_Type PRM_TOGGLE
~SIM_ForceOrbit() override
#define SIM_NAME_POINTPOSITION
constexpr SYS_FORCE_INLINE T & y() noexcept
GEO_API const TypeMask GEOPRIMPOLY
fpreal64 getOptionF(const UT_StringRef &name) const
const char * getToken() const
constexpr SYS_FORCE_INLINE T & x() noexcept