21 INLINE
bool BulletTranslationalLimitMotor::
22 is_limited(
int axis)
const {
24 nassertr((0 <= axis) && (axis <= 2),
false);
25 return _motor.isLimited(axis);
33 INLINE
void BulletTranslationalLimitMotor::
34 set_motor_enabled(
int axis,
bool enabled) {
36 nassertv((0 <= axis) && (axis <= 2));
37 _motor.m_enableMotor[axis] = enabled;
45 INLINE
bool BulletTranslationalLimitMotor::
46 get_motor_enabled(
int axis)
const {
48 nassertr((0 <= axis) && (axis <= 2),
false);
49 return _motor.m_enableMotor[axis];
57 INLINE
void BulletTranslationalLimitMotor::
61 _motor.m_lowerLimit = LVecBase3_to_btVector3(limit);
69 INLINE
void BulletTranslationalLimitMotor::
73 _motor.m_upperLimit = LVecBase3_to_btVector3(limit);
81 INLINE
void BulletTranslationalLimitMotor::
82 set_target_velocity(
const LVecBase3 &velocity) {
84 nassertv(!velocity.
is_nan());
85 _motor.m_targetVelocity = LVecBase3_to_btVector3(velocity);
93 INLINE
void BulletTranslationalLimitMotor::
94 set_max_motor_force(
const LVecBase3 &force) {
97 _motor.m_maxMotorForce = LVecBase3_to_btVector3(force);
105 INLINE
void BulletTranslationalLimitMotor::
106 set_damping(PN_stdfloat damping) {
108 _motor.m_damping = (btScalar)damping;
116 INLINE
void BulletTranslationalLimitMotor::
117 set_softness(PN_stdfloat softness) {
119 _motor.m_limitSoftness = (btScalar)softness;
127 INLINE
void BulletTranslationalLimitMotor::
128 set_restitution(PN_stdfloat restitution) {
130 _motor.m_restitution = (btScalar)restitution;
138 INLINE
void BulletTranslationalLimitMotor::
142 _motor.m_normalCFM = LVecBase3_to_btVector3(cfm);
150 INLINE
void BulletTranslationalLimitMotor::
154 _motor.m_stopCFM = LVecBase3_to_btVector3(cfm);
162 INLINE
void BulletTranslationalLimitMotor::
166 _motor.m_stopERP = LVecBase3_to_btVector3(erp);
180 nassertr((0 <= axis) && (axis <= 2),
false);
181 return _motor.m_currentLimit[axis];
189 INLINE
LVector3 BulletTranslationalLimitMotor::
190 get_current_error()
const {
192 return btVector3_to_LVector3(_motor.m_currentLimitError);
200 INLINE
LPoint3 BulletTranslationalLimitMotor::
201 get_current_diff()
const {
203 return btVector3_to_LPoint3(_motor.m_currentLinearDiff);
211 INLINE
LVector3 BulletTranslationalLimitMotor::
212 get_accumulated_impulse()
const {
214 return btVector3_to_LVector3(_motor.m_accumulatedImpulse);
This is the base class for all three-component vectors and points.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
int get_current_limit(int axis) const
Retrieves the current value of angle: 0 = free, 1 = at low limit, 2 = at high limit.