21 BulletTranslationalLimitMotor::
22 BulletTranslationalLimitMotor(btTranslationalLimitMotor &motor)
30 BulletTranslationalLimitMotor::
32 : _motor(copy._motor) {
39 bool BulletTranslationalLimitMotor::
40 is_limited(
int axis)
const {
43 nassertr((0 <= axis) && (axis <= 2),
false);
44 return _motor.isLimited(axis);
50 void BulletTranslationalLimitMotor::
51 set_motor_enabled(
int axis,
bool enabled) {
54 nassertv((0 <= axis) && (axis <= 2));
55 _motor.m_enableMotor[axis] = enabled;
61 bool BulletTranslationalLimitMotor::
62 get_motor_enabled(
int axis)
const {
65 nassertr((0 <= axis) && (axis <= 2),
false);
66 return _motor.m_enableMotor[axis];
73 void BulletTranslationalLimitMotor::
74 set_low_limit(
const LVecBase3 &limit) {
77 nassertv(!limit.is_nan());
78 _motor.m_lowerLimit = LVecBase3_to_btVector3(limit);
84 void BulletTranslationalLimitMotor::
85 set_high_limit(
const LVecBase3 &limit) {
88 nassertv(!limit.is_nan());
89 _motor.m_upperLimit = LVecBase3_to_btVector3(limit);
95 void BulletTranslationalLimitMotor::
96 set_target_velocity(
const LVecBase3 &velocity) {
99 nassertv(!velocity.is_nan());
100 _motor.m_targetVelocity = LVecBase3_to_btVector3(velocity);
106 void BulletTranslationalLimitMotor::
107 set_max_motor_force(
const LVecBase3 &force) {
110 nassertv(!force.is_nan());
111 _motor.m_maxMotorForce = LVecBase3_to_btVector3(force);
117 void BulletTranslationalLimitMotor::
118 set_damping(PN_stdfloat damping) {
121 _motor.m_damping = (btScalar)damping;
127 void BulletTranslationalLimitMotor::
128 set_softness(PN_stdfloat softness) {
131 _motor.m_limitSoftness = (btScalar)softness;
137 void BulletTranslationalLimitMotor::
138 set_restitution(PN_stdfloat restitution) {
141 _motor.m_restitution = (btScalar)restitution;
147 void BulletTranslationalLimitMotor::
148 set_normal_cfm(
const LVecBase3 &cfm) {
151 nassertv(!cfm.is_nan());
152 _motor.m_normalCFM = LVecBase3_to_btVector3(cfm);
158 void BulletTranslationalLimitMotor::
159 set_stop_cfm(
const LVecBase3 &cfm) {
162 nassertv(!cfm.is_nan());
163 _motor.m_stopCFM = LVecBase3_to_btVector3(cfm);
169 void BulletTranslationalLimitMotor::
170 set_stop_erp(
const LVecBase3 &erp) {
173 nassertv(!erp.is_nan());
174 _motor.m_stopERP = LVecBase3_to_btVector3(erp);
185 nassertr((0 <= axis) && (axis <= 2),
false);
186 return _motor.m_currentLimit[axis];
192 LVector3 BulletTranslationalLimitMotor::
193 get_current_error()
const {
196 return btVector3_to_LVector3(_motor.m_currentLimitError);
202 LPoint3 BulletTranslationalLimitMotor::
203 get_current_diff()
const {
206 return btVector3_to_LPoint3(_motor.m_currentLinearDiff);
212 LVector3 BulletTranslationalLimitMotor::
213 get_accumulated_impulse()
const {
216 return btVector3_to_LVector3(_motor.m_accumulatedImpulse);
int get_current_limit(int axis) const
Retrieves the current value of angle: 0 = free, 1 = at low limit, 2 = at high limit.
Rotation Limit structure for generic joints.
Similar to MutexHolder, but for a light mutex.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.