Blender V4.5
btConeTwistConstraint.h File Reference

Go to the source code of this file.

Classes

struct  btConeTwistConstraintDoubleData
struct  btConeTwistConstraintData
 this structure is not used, except for loading pre-2.82 .bullet files More...

Macros

#define btConeTwistConstraintData2   btConeTwistConstraintData
#define btConeTwistConstraintDataName   "btConeTwistConstraintData"

Enumerations

enum  btConeTwistFlags { BT_CONETWIST_FLAGS_LIN_CFM = 1 , BT_CONETWIST_FLAGS_LIN_ERP = 2 , BT_CONETWIST_FLAGS_ANG_CFM = 4 }

Functions

void init ()
void computeConeLimitInfo (const btQuaternion &qCone, btScalar &swingAngle, btVector3 &vSwingAxis, btScalar &swingLimit)
void computeTwistLimitInfo (const btQuaternion &qTwist, btScalar &twistAngle, btVector3 &vTwistAxis)
void adjustSwingAxisToUseEllipseNormal (btVector3 &vSwingAxis) const
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 btConeTwistConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame)
 btConeTwistConstraint (btRigidBody &rbA, const btTransform &rbAFrame)
virtual void buildJacobian ()
virtual void getInfo1 (btConstraintInfo1 *info)
void getInfo1NonVirtual (btConstraintInfo1 *info)
virtual void getInfo2 (btConstraintInfo2 *info)
void getInfo2NonVirtual (btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btMatrix3x3 &invInertiaWorldA, const btMatrix3x3 &invInertiaWorldB)
virtual void solveConstraintObsolete (btSolverBody &bodyA, btSolverBody &bodyB, btScalar timeStep)
 internal method used by the constraint solver, don't use them directly
void updateRHS (btScalar timeStep)
const btRigidBodygetRigidBodyA () const
const btRigidBodygetRigidBodyB () const
void setAngularOnly (bool angularOnly)
bool getAngularOnly () const
void setLimit (int limitIndex, btScalar limitValue)
btScalar getLimit (int limitIndex) const
void setLimit (btScalar _swingSpan1, btScalar _swingSpan2, btScalar _twistSpan, btScalar _softness=1.f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
const btTransformgetAFrame () const
const btTransformgetBFrame () const
int getSolveTwistLimit ()
int getSolveSwingLimit ()
btScalar getTwistLimitSign ()
void calcAngleInfo ()
void calcAngleInfo2 (const btTransform &transA, const btTransform &transB, const btMatrix3x3 &invInertiaWorldA, const btMatrix3x3 &invInertiaWorldB)
btScalar getSwingSpan1 () const
btScalar getSwingSpan2 () const
btScalar getTwistSpan () const
btScalar getLimitSoftness () const
btScalar getBiasFactor () const
btScalar getRelaxationFactor () const
btScalar getTwistAngle () const
bool isPastSwingLimit ()
btScalar getDamping () const
void setDamping (btScalar damping)
void enableMotor (bool b)
bool isMotorEnabled () const
btScalar getMaxMotorImpulse () const
bool isMaxMotorImpulseNormalized () const
void setMaxMotorImpulse (btScalar maxMotorImpulse)
void setMaxMotorImpulseNormalized (btScalar maxMotorImpulse)
btScalar getFixThresh ()
void setFixThresh (btScalar fixThresh)
void setMotorTarget (const btQuaternion &q)
const btQuaterniongetMotorTarget () const
void setMotorTargetInConstraintSpace (const btQuaternion &q)
btVector3 GetPointForAngle (btScalar fAngleInRadians, btScalar fLength) const
virtual void setParam (int num, btScalar value, int axis=-1)
virtual void setFrames (const btTransform &frameA, const btTransform &frameB)
const btTransformgetFrameOffsetA () const
const btTransformgetFrameOffsetB () const
virtual btScalar getParam (int num, int axis=-1) const
 return the local value of parameter
int getFlags () const
virtual int calculateSerializeBufferSize () const
virtual const char * serialize (void *dataBuffer, btSerializer *serializer) const
 fills the dataBuffer and returns the struct name (and 0 on failure)

Variables

btConeTwistConstraint __pad0__
 btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc)
btTransform m_rbAFrame
btTransform m_rbBFrame
btScalar m_limitSoftness
btScalar m_biasFactor
btScalar m_relaxationFactor
btScalar m_damping
btScalar m_swingSpan1
btScalar m_swingSpan2
btScalar m_twistSpan
btScalar m_fixThresh
btVector3 m_swingAxis
btVector3 m_twistAxis
btScalar m_kSwing
btScalar m_kTwist
btScalar m_twistLimitSign
btScalar m_swingCorrection
btScalar m_twistCorrection
btScalar m_twistAngle
btScalar m_accSwingLimitImpulse
btScalar m_accTwistLimitImpulse
bool m_angularOnly
bool m_solveTwistLimit
bool m_solveSwingLimit
bool m_useSolveConstraintObsolete
btScalar m_swingLimitRatio
btScalar m_twistLimitRatio
btVector3 m_twistAxisA
bool m_bMotorEnabled
bool m_bNormalizedMotorStrength
btQuaternion m_qTarget
btScalar m_maxMotorImpulse
btVector3 m_accMotorImpulse
int m_flags
btScalar m_linCFM
btScalar m_linERP
btScalar m_angCFM

Macro Definition Documentation

◆ btConeTwistConstraintData2

#define btConeTwistConstraintData2   btConeTwistConstraintData

Definition at line 43 of file btConeTwistConstraint.h.

◆ btConeTwistConstraintDataName

#define btConeTwistConstraintDataName   "btConeTwistConstraintData"

Definition at line 44 of file btConeTwistConstraint.h.

Enumeration Type Documentation

◆ btConeTwistFlags

Enumerator
BT_CONETWIST_FLAGS_LIN_CFM 
BT_CONETWIST_FLAGS_LIN_ERP 
BT_CONETWIST_FLAGS_ANG_CFM 

Definition at line 49 of file btConeTwistConstraint.h.

Function Documentation

◆ adjustSwingAxisToUseEllipseNormal()

void btConeTwistConstraint::adjustSwingAxisToUseEllipseNormal ( btVector3 & vSwingAxis) const
protected

Definition at line 929 of file btConeTwistConstraint.cpp.

References btVector3, fabs(), grad(), m_swingSpan1, m_swingSpan2, SIMD_EPSILON, y, and z().

Referenced by calcAngleInfo2(), and init().

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ btConeTwistConstraint() [1/2]

btConeTwistConstraint::btConeTwistConstraint ( btRigidBody & rbA,
btRigidBody & rbB,
const btTransform & rbAFrame,
const btTransform & rbBFrame )

◆ btConeTwistConstraint() [2/2]

btConeTwistConstraint::btConeTwistConstraint ( btRigidBody & rbA,
const btTransform & rbAFrame )

◆ buildJacobian()

◆ calcAngleInfo()

◆ calcAngleInfo2()

◆ calculateSerializeBufferSize()

virtual int calculateSerializeBufferSize ( ) const
virtual

◆ computeConeLimitInfo()

void btConeTwistConstraint::computeConeLimitInfo ( const btQuaternion & qCone,
btScalar & swingAngle,
btVector3 & vSwingAxis,
btScalar & swingLimit )
protected

◆ computeTwistLimitInfo()

void btConeTwistConstraint::computeTwistLimitInfo ( const btQuaternion & qTwist,
btScalar & twistAngle,
btVector3 & vTwistAxis )
protected

◆ enableMotor()

void enableMotor ( bool b)

Definition at line 298 of file btConeTwistConstraint.h.

References b, enableMotor(), and m_bMotorEnabled.

Referenced by enableAngularMotor(), enableMotor(), enableMotor(), and setAxis().

◆ getAFrame()

btTransform & getAFrame ( ) const

Definition at line 244 of file btConeTwistConstraint.h.

References btTransform, getAFrame(), and m_rbAFrame.

Referenced by getAFrame().

◆ getAngularOnly()

bool getAngularOnly ( ) const

Definition at line 165 of file btConeTwistConstraint.h.

References getAngularOnly(), and m_angularOnly.

Referenced by getAngularOnly(), and getAngularOnly().

◆ getBFrame()

btTransform & getBFrame ( ) const

Definition at line 245 of file btConeTwistConstraint.h.

References btTransform, getBFrame(), and m_rbBFrame.

Referenced by getBFrame().

◆ getBiasFactor()

btScalar getBiasFactor ( ) const
inline

Definition at line 281 of file btConeTwistConstraint.h.

References getBiasFactor(), and m_biasFactor.

Referenced by getBiasFactor().

◆ getDamping()

btScalar getDamping ( ) const

Definition at line 295 of file btConeTwistConstraint.h.

References getDamping(), and m_damping.

Referenced by getDamping(), and getDamping().

◆ getFixThresh()

btScalar getFixThresh ( )

Definition at line 313 of file btConeTwistConstraint.h.

References getFixThresh(), and m_fixThresh.

Referenced by getFixThresh().

◆ getFlags()

int getFlags ( ) const

Definition at line 347 of file btConeTwistConstraint.h.

References getFlags(), and m_flags.

Referenced by getFlags().

◆ getFrameOffsetA()

btTransform & getFrameOffsetA ( ) const

Definition at line 334 of file btConeTwistConstraint.h.

References btTransform, getFrameOffsetA(), and m_rbAFrame.

Referenced by getFrameOffsetA(), and getFrameOffsetA().

◆ getFrameOffsetB()

btTransform & getFrameOffsetB ( ) const

Definition at line 339 of file btConeTwistConstraint.h.

References btTransform, getFrameOffsetB(), and m_rbBFrame.

Referenced by getFrameOffsetB(), and getFrameOffsetB().

◆ getInfo1()

void getInfo1 ( btConstraintInfo1 * info)
virtual

References getInfo1(), and getInfo1NonVirtual().

Referenced by getInfo1(), and getInfo1().

◆ getInfo1NonVirtual()

void btSliderConstraint::getInfo1NonVirtual ( btConstraintInfo1 * info)

◆ getInfo2()

virtual void getInfo2 ( btConstraintInfo2 * info)
virtual

◆ getInfo2NonVirtual()

◆ getLimit()

btScalar getLimit ( int limitIndex) const

Definition at line 195 of file btConeTwistConstraint.h.

References btAssert, getLimit(), m_swingSpan1, m_swingSpan2, and m_twistSpan.

Referenced by getLimit().

◆ getLimitSoftness()

btScalar getLimitSoftness ( ) const
inline

Definition at line 277 of file btConeTwistConstraint.h.

References getLimitSoftness(), and m_limitSoftness.

Referenced by getLimitSoftness().

◆ getMaxMotorImpulse()

btScalar getMaxMotorImpulse ( ) const

Definition at line 300 of file btConeTwistConstraint.h.

References getMaxMotorImpulse(), and m_maxMotorImpulse.

Referenced by getMaxMotorImpulse(), and getMaxMotorImpulse().

◆ getMotorTarget()

const btQuaternion & getMotorTarget ( ) const

Definition at line 321 of file btConeTwistConstraint.h.

References getMotorTarget(), and m_qTarget.

Referenced by getMotorTarget().

◆ getParam()

virtual btScalar getParam ( int num,
int axis = -1 ) const
virtual

return the local value of parameter

References getParam(), and num.

Referenced by getParam(), and getParam().

◆ GetPointForAngle()

btVector3 btConeTwistConstraint::GetPointForAngle ( btScalar fAngleInRadians,
btScalar fLength ) const

◆ getRelaxationFactor()

btScalar getRelaxationFactor ( ) const
inline

Definition at line 285 of file btConeTwistConstraint.h.

References getRelaxationFactor(), and m_relaxationFactor.

Referenced by getRelaxationFactor().

◆ getRigidBodyA()

◆ getRigidBodyB()

◆ getSolveSwingLimit()

int getSolveSwingLimit ( )
inline

Definition at line 252 of file btConeTwistConstraint.h.

References getSolveSwingLimit(), and m_solveSwingLimit.

Referenced by getSolveSwingLimit().

◆ getSolveTwistLimit()

int getSolveTwistLimit ( )
inline

Definition at line 247 of file btConeTwistConstraint.h.

References getSolveTwistLimit(), and m_solveTwistLimit.

Referenced by getSolveTwistLimit().

◆ getSwingSpan1()

btScalar getSwingSpan1 ( ) const
inline

Definition at line 265 of file btConeTwistConstraint.h.

References getSwingSpan1(), and m_swingSpan1.

Referenced by getSwingSpan1().

◆ getSwingSpan2()

btScalar getSwingSpan2 ( ) const
inline

Definition at line 269 of file btConeTwistConstraint.h.

References getSwingSpan2(), and m_swingSpan2.

Referenced by getSwingSpan2().

◆ getTwistAngle()

btScalar getTwistAngle ( ) const
inline

Definition at line 289 of file btConeTwistConstraint.h.

References getTwistAngle(), and m_twistAngle.

Referenced by getTwistAngle().

◆ getTwistLimitSign()

btScalar getTwistLimitSign ( )
inline

Definition at line 257 of file btConeTwistConstraint.h.

References getTwistLimitSign(), and m_twistLimitSign.

Referenced by getTwistLimitSign().

◆ getTwistSpan()

btScalar getTwistSpan ( ) const
inline

Definition at line 273 of file btConeTwistConstraint.h.

References getTwistSpan(), and m_twistSpan.

Referenced by getTwistSpan().

◆ init()

void init ( )
protected

References adjustSwingAxisToUseEllipseNormal(), btVector3, computeConeLimitInfo(), computeTwistLimitInfo(), and init().

Referenced by blender::bke::add_custom_data_layer_from_attribute_init(), blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor(), BKE_mesh_legacy_convert_uvs_to_generic(), BMO_op_init(), blender::array_utils::booleans_mix_calc(), bounds_min_max_with_transform(), btConeTwistConstraint(), btConeTwistConstraint(), btGeneric6DofSpringConstraint(), btGeneric6DofSpringConstraint(), btSymMatrix< T >::btSymMatrix(), Buffer_new(), blender::bke::build_mesh_positions(), blender::ed::vse::ScopeHistogram::calc_from_ibuf(), blender::bke::calculate_type_counts(), blender::ed::curves::contains(), blender::ed::pointcloud::contains(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::array_utils::count_booleans(), blender::gpu::MTLContext::debug_capture_begin(), deform_verts(), ED_area_type_hud_ensure(), ed_curves_select_pick(), ed_grease_pencil_select_pick(), blender::gpu::MTLContext::ensure_depth_stencil_state(), blender::ed::curves::find_closest_curve(), blender::ed::curves::find_closest_curve_to_screen_co(), blender::ed::curves::find_closest_point_to_screen_co(), blender::ed::pointcloud::find_closest_point_to_screen_co(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), blender::bke::gather_attributes(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), blender::gpu::MTLContextComputeUtils::get_buffer_clear_pso(), GHOST_ContextCGL::GHOST_ContextCGL(), ghost_fatal_error_dialog(), heapsimple_down(), init(), init(), init(), init(), init(), blender::gpu::MTLTexture::init_internal(), blender::ed::sculpt_paint::load_tex(), blender::ed::sculpt_paint::load_tex_cursor(), blender::bounds::min_max(), blender::bounds::min_max(), blender::bounds::min_max_with_radii(), blender::gpu::MTLFrameBuffer::MTLFrameBuffer(), pointcloud_select_pick(), pygpu_buffer__tp_new(), register_node_type_tex_bricks(), register_node_type_tex_image(), register_node_type_tex_output(), blender::gpu::MTLBackend::render_begin(), blender::gpu::MTLBackend::render_step(), blender::ed::sculpt_paint::replace_attribute(), btSymMatrix< T >::resize(), blender::gpu::MTLContext::sampler_state_cache_init(), blender::ed::transform::snap_object_data_editmesh_get(), blender::seq::tonemap_calc_input_luminance(), blender::bke::try_add_shared_field_attribute(), blender::ed::greasepencil::weight_sample_invoke(), WM_tooltip_immediate_init(), WM_tooltip_timer_init(), and WM_tooltip_timer_init_ex().

◆ isMaxMotorImpulseNormalized()

bool isMaxMotorImpulseNormalized ( ) const

◆ isMotorEnabled()

bool isMotorEnabled ( ) const

Definition at line 299 of file btConeTwistConstraint.h.

References isMotorEnabled(), and m_bMotorEnabled.

Referenced by isMotorEnabled().

◆ isPastSwingLimit()

bool isPastSwingLimit ( )

Definition at line 293 of file btConeTwistConstraint.h.

References isPastSwingLimit(), and m_solveSwingLimit.

Referenced by isPastSwingLimit().

◆ serialize()

virtual const char * serialize ( void * dataBuffer,
btSerializer * serializer ) const
virtual

fills the dataBuffer and returns the struct name (and 0 on failure)

References serialize().

◆ setAngularOnly()

void setAngularOnly ( bool angularOnly)

Definition at line 160 of file btConeTwistConstraint.h.

References m_angularOnly, and setAngularOnly().

Referenced by setAngularOnly().

◆ setDamping()

void setDamping ( btScalar damping)

Definition at line 296 of file btConeTwistConstraint.h.

References m_damping, and setDamping().

Referenced by btHinge2Constraint(), setDamping(), setDamping(), and setDamping().

◆ setFixThresh()

void setFixThresh ( btScalar fixThresh)

Definition at line 314 of file btConeTwistConstraint.h.

References m_fixThresh, and setFixThresh().

Referenced by setFixThresh().

◆ setFrames()

void btHingeConstraint::setFrames ( const btTransform & frameA,
const btTransform & frameB )
virtual

Definition at line 1110 of file btConeTwistConstraint.cpp.

References btTransform, buildJacobian(), m_rbAFrame, and m_rbBFrame.

Referenced by setFrames(), setParam(), and updateRHS().

◆ setLimit() [1/2]

void setLimit ( btScalar _swingSpan1,
btScalar _swingSpan2,
btScalar _twistSpan,
btScalar _softness = 1.f,
btScalar _biasFactor = 0.3f,
btScalar _relaxationFactor = 1.0f )

◆ setLimit() [2/2]

void setLimit ( int limitIndex,
btScalar limitValue )

Definition at line 170 of file btConeTwistConstraint.h.

References m_swingSpan1, m_swingSpan2, m_twistSpan, and setLimit().

Referenced by setLimit(), setLimit(), setLimit(), and setLimit().

◆ setMaxMotorImpulse()

void setMaxMotorImpulse ( btScalar maxMotorImpulse)

◆ setMaxMotorImpulseNormalized()

void setMaxMotorImpulseNormalized ( btScalar maxMotorImpulse)

◆ setMotorTarget()

void btConeTwistConstraint::setMotorTarget ( const btQuaternion & q)

Definition at line 961 of file btConeTwistConstraint.cpp.

References m_rbAFrame, m_rbBFrame, and setMotorTargetInConstraintSpace().

Referenced by setMotorTarget().

◆ setMotorTargetInConstraintSpace()

◆ setParam()

virtual void setParam ( int num,
btScalar value,
int axis = -1 )
virtual

override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). If no axis is provided, it uses the default axis for this constraint.

References btTransform, num, setFrames(), and setParam().

Referenced by setParam(), and setParam().

◆ solveConstraintObsolete()

◆ updateRHS()

void btPoint2PointConstraint::updateRHS ( btScalar timeStep)

Definition at line 509 of file btConeTwistConstraint.cpp.

Referenced by getInfo2(), and updateRHS().

Variable Documentation

◆ __pad0__

btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc)

Definition at line 58 of file btConeTwistConstraint.h.

◆ m_accMotorImpulse

btVector3 m_accMotorImpulse

Definition at line 111 of file btConeTwistConstraint.h.

Referenced by buildJacobian(), and solveConstraintObsolete().

◆ m_accSwingLimitImpulse

btScalar m_accSwingLimitImpulse

Definition at line 92 of file btConeTwistConstraint.h.

Referenced by buildJacobian(), and solveConstraintObsolete().

◆ m_accTwistLimitImpulse

btScalar m_accTwistLimitImpulse

Definition at line 93 of file btConeTwistConstraint.h.

Referenced by buildJacobian(), and solveConstraintObsolete().

◆ m_angCFM

btScalar m_angCFM

Definition at line 117 of file btConeTwistConstraint.h.

Referenced by getInfo2NonVirtual().

◆ m_angularOnly

◆ m_biasFactor

◆ m_bMotorEnabled

bool m_bMotorEnabled

◆ m_bNormalizedMotorStrength

bool m_bNormalizedMotorStrength

◆ m_damping

btScalar m_damping

Definition at line 72 of file btConeTwistConstraint.h.

Referenced by getDamping(), setDamping(), and solveConstraintObsolete().

◆ m_fixThresh

btScalar m_fixThresh

◆ m_flags

◆ m_kSwing

btScalar m_kSwing

Definition at line 83 of file btConeTwistConstraint.h.

Referenced by calcAngleInfo2(), and solveConstraintObsolete().

◆ m_kTwist

btScalar m_kTwist

Definition at line 84 of file btConeTwistConstraint.h.

Referenced by calcAngleInfo2(), and solveConstraintObsolete().

◆ m_limitSoftness

◆ m_linCFM

btScalar m_linCFM

Definition at line 115 of file btConeTwistConstraint.h.

Referenced by getInfo2NonVirtual().

◆ m_linERP

btScalar m_linERP

Definition at line 116 of file btConeTwistConstraint.h.

Referenced by getInfo2NonVirtual().

◆ m_maxMotorImpulse

◆ m_qTarget

◆ m_rbAFrame

◆ m_rbBFrame

◆ m_relaxationFactor

◆ m_solveSwingLimit

◆ m_solveTwistLimit

bool m_solveTwistLimit

◆ m_swingAxis

◆ m_swingCorrection

btScalar m_swingCorrection

◆ m_swingLimitRatio

btScalar m_swingLimitRatio

Definition at line 102 of file btConeTwistConstraint.h.

Referenced by calcAngleInfo2(), and solveConstraintObsolete().

◆ m_swingSpan1

◆ m_swingSpan2

◆ m_twistAngle

btScalar m_twistAngle

Definition at line 90 of file btConeTwistConstraint.h.

Referenced by calcAngleInfo(), calcAngleInfo2(), and getTwistAngle().

◆ m_twistAxis

◆ m_twistAxisA

btVector3 m_twistAxisA

Definition at line 104 of file btConeTwistConstraint.h.

Referenced by calcAngleInfo2(), and solveConstraintObsolete().

◆ m_twistCorrection

btScalar m_twistCorrection

◆ m_twistLimitRatio

btScalar m_twistLimitRatio

Definition at line 103 of file btConeTwistConstraint.h.

Referenced by calcAngleInfo2(), and solveConstraintObsolete().

◆ m_twistLimitSign

btScalar m_twistLimitSign

Definition at line 86 of file btConeTwistConstraint.h.

Referenced by calcAngleInfo(), calcAngleInfo2(), and getTwistLimitSign().

◆ m_twistSpan

◆ m_useSolveConstraintObsolete