mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
opt dbg stmts
This commit is contained in:
parent
d1bb182803
commit
ea49c21967
@ -25,8 +25,9 @@ NotifyCategoryDef(correction, "");
|
|||||||
|
|
||||||
Correction::Correction(LPoint3f& start, LVector3f& s_vel) : _curr_p(start),
|
Correction::Correction(LPoint3f& start, LVector3f& s_vel) : _curr_p(start),
|
||||||
_curr_v(s_vel) {
|
_curr_v(s_vel) {
|
||||||
correction_cat->debug() << "construction with:" << endl << "start = "
|
if(correction_cat.is_debug())
|
||||||
<< start << endl << "vel = " << s_vel << endl;
|
correction_cat->debug() << "construction with:" << endl << "start = "
|
||||||
|
<< start << endl << "vel = " << s_vel << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Correction::~Correction(void) {
|
Correction::~Correction(void) {
|
||||||
@ -138,18 +139,22 @@ void SplineCorrection::step(void) {
|
|||||||
_curr_p = (tmp * tmp * tmp * A) + (tmp * tmp * B) + (tmp * C) + D;
|
_curr_p = (tmp * tmp * tmp * A) + (tmp * tmp * B) + (tmp * C) + D;
|
||||||
_curr_v = (3.0f * tmp * tmp * A) + (2.0f * tmp * B) + C;
|
_curr_v = (3.0f * tmp * tmp * A) + (2.0f * tmp * B) + C;
|
||||||
time += ClockObject::get_global_clock()->get_dt();
|
time += ClockObject::get_global_clock()->get_dt();
|
||||||
correction_cat->spam() << "new possition = " << _curr_p << endl;
|
if(correction_cat.is_spam()) {
|
||||||
correction_cat->spam() << "new vel = " << _curr_v << endl;
|
correction_cat->spam() << "new possition = " << _curr_p << endl;
|
||||||
|
correction_cat->spam() << "new vel = " << _curr_v << endl;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
|
if(correction_cat.is_spam())
|
||||||
correction_cat->spam() << "time >= dur, holding at current pos" << endl;
|
correction_cat->spam() << "time >= dur, holding at current pos" << endl;
|
||||||
} else
|
} else
|
||||||
correction_cat->spam() << "have_both is false, no point calculated"
|
if(correction_cat.is_spam())
|
||||||
<< endl;
|
correction_cat->spam() << "have_both is false, no point calculated" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplineCorrection::new_target(LPoint3f& target, LVector3f& v_target) {
|
void SplineCorrection::new_target(LPoint3f& target, LVector3f& v_target) {
|
||||||
if (target == save_p) {
|
if (target == save_p) {
|
||||||
correction_cat->spam() << "new target: same point, no action" << endl;
|
if(correction_cat.is_spam())
|
||||||
|
correction_cat->spam() << "new target: same point, no action" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (have_both) {
|
if (have_both) {
|
||||||
@ -162,13 +167,15 @@ void SplineCorrection::new_target(LPoint3f& target, LVector3f& v_target) {
|
|||||||
B = (3.0f * (save_p - prev_p)) - (2.0f * prev_v) - save_v;
|
B = (3.0f * (save_p - prev_p)) - (2.0f * prev_v) - save_v;
|
||||||
C = prev_v;
|
C = prev_v;
|
||||||
D = prev_p;
|
D = prev_p;
|
||||||
correction_cat->debug() << "new target: already had 'both'." << endl;
|
if(correction_cat.is_debug()) {
|
||||||
correction_cat->debug() << "target = " << target << endl;
|
correction_cat->debug() << "new target: already had 'both'." << endl;
|
||||||
correction_cat->debug() << "vel = " << v_target << endl;
|
correction_cat->debug() << "target = " << target << endl;
|
||||||
correction_cat->debug() << "A = " << A << endl;
|
correction_cat->debug() << "vel = " << v_target << endl;
|
||||||
correction_cat->debug() << "B = " << B << endl;
|
correction_cat->debug() << "A = " << A << endl;
|
||||||
correction_cat->debug() << "C = " << C << endl;
|
correction_cat->debug() << "B = " << B << endl;
|
||||||
correction_cat->debug() << "D = " << D << endl;
|
correction_cat->debug() << "C = " << C << endl;
|
||||||
|
correction_cat->debug() << "D = " << D << endl;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
save_p = target;
|
save_p = target;
|
||||||
save_v = v_target;
|
save_v = v_target;
|
||||||
@ -180,19 +187,22 @@ void SplineCorrection::new_target(LPoint3f& target, LVector3f& v_target) {
|
|||||||
C = prev_v;
|
C = prev_v;
|
||||||
D = prev_p;
|
D = prev_p;
|
||||||
have_both = true;
|
have_both = true;
|
||||||
correction_cat->debug() << "new target: now have 'both'." << endl;
|
if(correction_cat.is_debug()) {
|
||||||
correction_cat->debug() << "target = " << target << endl;
|
correction_cat->debug() << "new target: now have 'both'." << endl;
|
||||||
correction_cat->debug() << "vel = " << v_target << endl;
|
correction_cat->debug() << "target = " << target << endl;
|
||||||
correction_cat->debug() << "A = " << A << endl;
|
correction_cat->debug() << "vel = " << v_target << endl;
|
||||||
correction_cat->debug() << "B = " << B << endl;
|
correction_cat->debug() << "A = " << A << endl;
|
||||||
correction_cat->debug() << "C = " << C << endl;
|
correction_cat->debug() << "B = " << B << endl;
|
||||||
correction_cat->debug() << "D = " << D << endl;
|
correction_cat->debug() << "C = " << C << endl;
|
||||||
|
correction_cat->debug() << "D = " << D << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplineCorrection::force_target(LPoint3f& target, LVector3f& v_target) {
|
void SplineCorrection::force_target(LPoint3f& target, LVector3f& v_target) {
|
||||||
if (target == save_p) {
|
if (target == save_p) {
|
||||||
correction_cat->debug() << "force target: same point, no action" << endl;
|
if(correction_cat.is_debug())
|
||||||
|
correction_cat->debug() << "force target: same point, no action" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_curr_p = prev_p = save_p = target;
|
_curr_p = prev_p = save_p = target;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user