15 #include "physxSphericalJointDesc.h" 16 #include "physxManager.h" 17 #include "physxSpringDesc.h" 18 #include "physxJointLimitDesc.h" 28 _desc.projectionDistance = distance;
37 set_flag(PhysxSphericalJointFlag flag,
bool value) {
43 _desc.flags &= ~(flag);
55 _desc.twistSpring = spring._desc;
66 _desc.swingSpring = spring._desc;
77 _desc.jointSpring = spring._desc;
89 nassertv( !axis.
is_nan() );
102 _desc.projectionMode = (NxJointProjectionMode)mode;
113 _desc.twistLimit.low = low._desc;
124 _desc.twistLimit.high = high._desc;
135 _desc.swingLimit = limit._desc;
143 float PhysxSphericalJointDesc::
144 get_projection_distance()
const {
146 return _desc.projectionDistance;
154 bool PhysxSphericalJointDesc::
155 get_flag(PhysxSphericalJointFlag flag)
const {
157 return (_desc.flags & flag) ? true :
false;
166 get_twist_spring()
const {
169 value._desc = _desc.twistSpring;
179 get_swing_spring()
const {
182 value._desc = _desc.swingSpring;
192 get_joint_spring()
const {
195 value._desc = _desc.jointSpring;
205 get_swing_axis()
const {
215 PhysxEnums::PhysxProjectionMode PhysxSphericalJointDesc::
216 get_projection_mode()
const {
218 return (PhysxProjectionMode)_desc.projectionMode;
227 get_twist_limit_low()
const {
230 value._desc = _desc.twistLimit.low;
240 get_twist_limit_high()
const {
243 value._desc = _desc.twistLimit.high;
256 value._desc = _desc.swingLimit;
void set_projection_distance(float distance)
Set the distance above which to project joint.
void set_joint_spring(const PhysxSpringDesc &spring)
Sets a spring that lets the joint get pulled apart.
void set_twist_limit_high(const PhysxJointLimitDesc &high)
Limits rotation around twist axis.
void set_twist_limit_low(const PhysxJointLimitDesc &low)
Limits rotation around twist axis.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Describes a joint spring.
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
void set_swing_spring(const PhysxSpringDesc &spring)
Sets a spring that works against swinging.
void set_swing_limit(const PhysxJointLimitDesc &limit)
Limits swing of twist axis.
PhysxJointLimitDesc get_swing_limit() const
Limits swing of twist axis.
static NxVec3 vec3_to_nxVec3(const LVector3f &v)
Converts from LVector3f to NxVec3.
void set_projection_mode(PhysxProjectionMode mode)
Use this to enable joint projection.
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
void set_swing_axis(const LVector3f &axis)
Set the swing limit axis defined in the joint space of actor 0.
void set_twist_spring(const PhysxSpringDesc &spring)
Sets a spring that works against twisting.
void set_flag(PhysxSphericalJointFlag flag, bool value)
Sets or clears a single SphericalJointFlag flag.