stdfloat_double
This commit is contained in:
parent
9e22c72bf3
commit
501470169f
|
|
@ -29,7 +29,7 @@
|
|||
// are the same.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_pos(const LVecBase3f &pos) {
|
||||
set_pos(const LVecBase3 &pos) {
|
||||
return set_x(pos[0]) | set_y(pos[1]) | set_z(pos[2]);
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ set_pos(const LVecBase3f &pos) {
|
|||
// are the same.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_pos(float x, float y, float z) {
|
||||
set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
|
||||
return set_x(x) | set_y(y) | set_z(z);
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ set_pos(float x, float y, float z) {
|
|||
// Description: Sets the X position only. See set_pos().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_x(float x) {
|
||||
set_x(PN_stdfloat x) {
|
||||
bool result = (x != _sample._pos[0]);
|
||||
/*
|
||||
if (deadrec_cat.is_debug()) {
|
||||
|
|
@ -76,7 +76,7 @@ set_x(float x) {
|
|||
// Description: Sets the Y position only. See set_pos().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_y(float y) {
|
||||
set_y(PN_stdfloat y) {
|
||||
bool result = (y != _sample._pos[1]);
|
||||
/*
|
||||
if (deadrec_cat.is_debug()) {
|
||||
|
|
@ -93,7 +93,7 @@ set_y(float y) {
|
|||
// Description: Sets the Z position only. See set_pos().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_z(float z) {
|
||||
set_z(PN_stdfloat z) {
|
||||
bool result = (z != _sample._pos[2]);
|
||||
/*
|
||||
if (deadrec_cat.is_debug()) {
|
||||
|
|
@ -120,7 +120,7 @@ set_z(float z) {
|
|||
// are the same.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_hpr(const LVecBase3f &hpr) {
|
||||
set_hpr(const LVecBase3 &hpr) {
|
||||
return set_h(hpr[0]) | set_p(hpr[1]) | set_r(hpr[2]);
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ set_hpr(const LVecBase3f &hpr) {
|
|||
// are the same.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_hpr(float h, float p, float r) {
|
||||
set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
|
||||
return set_h(h) | set_p(p) | set_r(r);
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ set_hpr(float h, float p, float r) {
|
|||
// Description: Sets the heading only. See set_hpr().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_h(float h) {
|
||||
set_h(PN_stdfloat h) {
|
||||
bool result = (h != _sample._hpr[0]);
|
||||
/*
|
||||
if (deadrec_cat.is_debug()) {
|
||||
|
|
@ -167,7 +167,7 @@ set_h(float h) {
|
|||
// Description: Sets the pitch only. See set_hpr().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_p(float p) {
|
||||
set_p(PN_stdfloat p) {
|
||||
bool result = (p != _sample._hpr[1]);
|
||||
/*
|
||||
if (deadrec_cat.is_debug()) {
|
||||
|
|
@ -184,7 +184,7 @@ set_p(float p) {
|
|||
// Description: Sets the roll only. See set_hpr().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_r(float r) {
|
||||
set_r(PN_stdfloat r) {
|
||||
bool result = (r != _sample._hpr[2]);
|
||||
/*
|
||||
if (deadrec_cat.is_debug()) {
|
||||
|
|
@ -211,7 +211,7 @@ set_r(float r) {
|
|||
// are the same.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_pos_hpr(const LVecBase3f &pos, const LVecBase3f &hpr) {
|
||||
set_pos_hpr(const LVecBase3 &pos, const LVecBase3 &hpr) {
|
||||
return (set_x(pos[0]) | set_y(pos[1]) | set_z(pos[2]) |
|
||||
set_h(hpr[0]) | set_p(hpr[1]) | set_r(hpr[2]));
|
||||
}
|
||||
|
|
@ -232,7 +232,7 @@ set_pos_hpr(const LVecBase3f &pos, const LVecBase3f &hpr) {
|
|||
// are the same.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool SmoothMover::
|
||||
set_pos_hpr(float x, float y, float z, float h, float p, float r) {
|
||||
set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
|
||||
return set_x(x) | set_y(y) | set_z(z) | set_h(h) | set_p(p) | set_r(r);
|
||||
}
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ set_pos_hpr(float x, float y, float z, float h, float p, float r) {
|
|||
// copied to the sample point table when
|
||||
// mark_position() is called.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const LPoint3f &SmoothMover::
|
||||
INLINE const LPoint3 &SmoothMover::
|
||||
get_sample_pos() const {
|
||||
return _sample._pos;
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@ get_sample_pos() const {
|
|||
// copied to the sample point table when
|
||||
// mark_position() is called.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const LVecBase3f &SmoothMover::
|
||||
INLINE const LVecBase3 &SmoothMover::
|
||||
get_sample_hpr() const {
|
||||
return _sample._hpr;
|
||||
}
|
||||
|
|
@ -355,7 +355,7 @@ compute_smooth_position() {
|
|||
// Description: Returns the smoothed position as computed by a
|
||||
// previous call to compute_smooth_position().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const LPoint3f &SmoothMover::
|
||||
INLINE const LPoint3 &SmoothMover::
|
||||
get_smooth_pos() const {
|
||||
return _smooth_pos;
|
||||
}
|
||||
|
|
@ -366,7 +366,7 @@ get_smooth_pos() const {
|
|||
// Description: Returns the smoothed position as computed by a
|
||||
// previous call to compute_smooth_position().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const LVecBase3f &SmoothMover::
|
||||
INLINE const LVecBase3 &SmoothMover::
|
||||
get_forward_axis() const {
|
||||
return _forward_axis;
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ get_forward_axis() const {
|
|||
// Description: Returns the smoothed orientation as computed by a
|
||||
// previous call to compute_smooth_position().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const LVecBase3f &SmoothMover::
|
||||
INLINE const LVecBase3 &SmoothMover::
|
||||
get_smooth_hpr() const {
|
||||
return _smooth_hpr;
|
||||
}
|
||||
|
|
@ -480,7 +480,7 @@ compute_and_apply_smooth_hpr(NodePath &hpr_node) {
|
|||
// number if the avatar is moving forward, and a
|
||||
// negative number if it is moving backward.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float SmoothMover::
|
||||
INLINE PN_stdfloat SmoothMover::
|
||||
get_smooth_forward_velocity() const {
|
||||
return _smooth_forward_velocity;
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ get_smooth_forward_velocity() const {
|
|||
// number if the avatar is moving right, and a
|
||||
// negative number if it is moving left.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float SmoothMover::
|
||||
INLINE PN_stdfloat SmoothMover::
|
||||
get_smooth_lateral_velocity() const {
|
||||
return _smooth_lateral_velocity;
|
||||
}
|
||||
|
|
@ -507,7 +507,7 @@ get_smooth_lateral_velocity() const {
|
|||
// second. This may be positive or negative, according
|
||||
// to the direction of rotation.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float SmoothMover::
|
||||
INLINE PN_stdfloat SmoothMover::
|
||||
get_smooth_rotational_velocity() const {
|
||||
return _smooth_rotational_velocity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@ mark_position() {
|
|||
|
||||
// We also need to compute the velocity here.
|
||||
if (_smooth_position_known) {
|
||||
LVector3f pos_delta = _sample._pos - _smooth_pos;
|
||||
LVecBase3f hpr_delta = _sample._hpr - _smooth_hpr;
|
||||
LVector3 pos_delta = _sample._pos - _smooth_pos;
|
||||
LVecBase3 hpr_delta = _sample._hpr - _smooth_hpr;
|
||||
double age = timestamp - _smooth_timestamp;
|
||||
age = min(age, _max_position_age);
|
||||
|
||||
|
|
@ -583,7 +583,7 @@ write(ostream &out) const {
|
|||
// the indicated timestamp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void SmoothMover::
|
||||
set_smooth_pos(const LPoint3f &pos, const LVecBase3f &hpr,
|
||||
set_smooth_pos(const LPoint3 &pos, const LVecBase3 &hpr,
|
||||
double timestamp) {
|
||||
if (deadrec_cat.is_spam()) {
|
||||
deadrec_cat.spam()
|
||||
|
|
@ -661,8 +661,8 @@ linear_interpolate(int point_before, int point_after, double timestamp) {
|
|||
}
|
||||
|
||||
double t = (timestamp - point_b._timestamp) / age;
|
||||
LVector3f pos_delta = point_a._pos - point_b._pos;
|
||||
LVecBase3f hpr_delta = point_a._hpr - point_b._hpr;
|
||||
LVector3 pos_delta = point_a._pos - point_b._pos;
|
||||
LVecBase3 hpr_delta = point_a._hpr - point_b._hpr;
|
||||
|
||||
if (deadrec_cat.is_spam()) {
|
||||
deadrec_cat.spam()
|
||||
|
|
@ -683,7 +683,7 @@ linear_interpolate(int point_before, int point_after, double timestamp) {
|
|||
// moving object.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void SmoothMover::
|
||||
compute_velocity(const LVector3f &pos_delta, const LVecBase3f &hpr_delta,
|
||||
compute_velocity(const LVector3 &pos_delta, const LVecBase3 &hpr_delta,
|
||||
double age) {
|
||||
_smooth_rotational_velocity = hpr_delta[0] / age;
|
||||
|
||||
|
|
@ -692,9 +692,9 @@ compute_velocity(const LVector3f &pos_delta, const LVecBase3f &hpr_delta,
|
|||
// the velocity vector onto the y axis, as rotated by the current
|
||||
// hpr.
|
||||
if (!_computed_forward_axis) {
|
||||
LMatrix3f rot_mat;
|
||||
compose_matrix(rot_mat, LVecBase3f(1.0, 1.0, 1.0), _smooth_hpr);
|
||||
_forward_axis = LVector3f(0.0, 1.0, 0.0) * rot_mat;
|
||||
LMatrix3 rot_mat;
|
||||
compose_matrix(rot_mat, LVecBase3(1.0, 1.0, 1.0), _smooth_hpr);
|
||||
_forward_axis = LVector3(0.0, 1.0, 0.0) * rot_mat;
|
||||
|
||||
if (deadrec_cat.is_spam()) {
|
||||
deadrec_cat.spam()
|
||||
|
|
@ -702,10 +702,10 @@ compute_velocity(const LVector3f &pos_delta, const LVecBase3f &hpr_delta,
|
|||
}
|
||||
}
|
||||
|
||||
LVector3f lateral_axis = _forward_axis.cross(LVector3f(0.0,0.0,1.0));
|
||||
LVector3 lateral_axis = _forward_axis.cross(LVector3(0.0,0.0,1.0));
|
||||
|
||||
float forward_distance = pos_delta.dot(_forward_axis);
|
||||
float lateral_distance = pos_delta.dot(lateral_axis);
|
||||
PN_stdfloat forward_distance = pos_delta.dot(_forward_axis);
|
||||
PN_stdfloat lateral_distance = pos_delta.dot(lateral_axis);
|
||||
|
||||
_smooth_forward_velocity = forward_distance / age;
|
||||
_smooth_lateral_velocity = lateral_distance / age;
|
||||
|
|
|
|||
|
|
@ -54,23 +54,23 @@ PUBLISHED:
|
|||
// mark_position(). The return value of each function is true if
|
||||
// the parameter value has changed, or false if it remains the same
|
||||
// as last time.
|
||||
INLINE bool set_pos(const LVecBase3f &pos);
|
||||
INLINE bool set_pos(float x, float y, float z);
|
||||
INLINE bool set_x(float x);
|
||||
INLINE bool set_y(float y);
|
||||
INLINE bool set_z(float z);
|
||||
INLINE bool set_pos(const LVecBase3 &pos);
|
||||
INLINE bool set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
|
||||
INLINE bool set_x(PN_stdfloat x);
|
||||
INLINE bool set_y(PN_stdfloat y);
|
||||
INLINE bool set_z(PN_stdfloat z);
|
||||
|
||||
INLINE bool set_hpr(const LVecBase3f &hpr);
|
||||
INLINE bool set_hpr(float h, float p, float r);
|
||||
INLINE bool set_h(float h);
|
||||
INLINE bool set_p(float p);
|
||||
INLINE bool set_r(float r);
|
||||
INLINE bool set_hpr(const LVecBase3 &hpr);
|
||||
INLINE bool set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
|
||||
INLINE bool set_h(PN_stdfloat h);
|
||||
INLINE bool set_p(PN_stdfloat p);
|
||||
INLINE bool set_r(PN_stdfloat r);
|
||||
|
||||
INLINE bool set_pos_hpr(const LVecBase3f &pos, const LVecBase3f &hpr);
|
||||
INLINE bool set_pos_hpr(float x, float y, float z, float h, float p, float r);
|
||||
INLINE bool set_pos_hpr(const LVecBase3 &pos, const LVecBase3 &hpr);
|
||||
INLINE bool set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
|
||||
|
||||
INLINE const LPoint3f &get_sample_pos() const;
|
||||
INLINE const LVecBase3f &get_sample_hpr() const;
|
||||
INLINE const LPoint3 &get_sample_pos() const;
|
||||
INLINE const LVecBase3 &get_sample_hpr() const;
|
||||
|
||||
INLINE void set_phony_timestamp(double timestamp = 0.0, bool period_adjust = false);
|
||||
|
||||
|
|
@ -86,8 +86,8 @@ PUBLISHED:
|
|||
bool compute_smooth_position(double timestamp);
|
||||
bool get_latest_position();
|
||||
|
||||
INLINE const LPoint3f &get_smooth_pos() const;
|
||||
INLINE const LVecBase3f &get_smooth_hpr() const;
|
||||
INLINE const LPoint3 &get_smooth_pos() const;
|
||||
INLINE const LVecBase3 &get_smooth_hpr() const;
|
||||
|
||||
INLINE void apply_smooth_pos(NodePath &node) const;
|
||||
INLINE void apply_smooth_pos_hpr(NodePath &pos_node, NodePath &hpr_node) const;
|
||||
|
|
@ -97,10 +97,10 @@ PUBLISHED:
|
|||
INLINE void compute_and_apply_smooth_pos_hpr(NodePath &pos_node, NodePath &hpr_node);
|
||||
INLINE void compute_and_apply_smooth_hpr(NodePath &hpr_node);
|
||||
|
||||
INLINE float get_smooth_forward_velocity() const;
|
||||
INLINE float get_smooth_lateral_velocity() const;
|
||||
INLINE float get_smooth_rotational_velocity() const;
|
||||
INLINE const LVecBase3f &get_forward_axis() const;
|
||||
INLINE PN_stdfloat get_smooth_forward_velocity() const;
|
||||
INLINE PN_stdfloat get_smooth_lateral_velocity() const;
|
||||
INLINE PN_stdfloat get_smooth_rotational_velocity() const;
|
||||
INLINE const LVecBase3 &get_forward_axis() const;
|
||||
|
||||
void handle_wrt_reparent(NodePath &old_parent, NodePath &new_parent);
|
||||
|
||||
|
|
@ -149,11 +149,11 @@ PUBLISHED:
|
|||
void write(ostream &out) const;
|
||||
|
||||
private:
|
||||
void set_smooth_pos(const LPoint3f &pos, const LVecBase3f &hpr,
|
||||
void set_smooth_pos(const LPoint3 &pos, const LVecBase3 &hpr,
|
||||
double timestamp);
|
||||
void linear_interpolate(int point_before, int point_after, double timestamp);
|
||||
void compute_velocity(const LVector3f &pos_delta,
|
||||
const LVecBase3f &hpr_delta,
|
||||
void compute_velocity(const LVector3 &pos_delta,
|
||||
const LVecBase3 &hpr_delta,
|
||||
double age);
|
||||
|
||||
void record_timestamp_delay(double timestamp);
|
||||
|
|
@ -164,17 +164,17 @@ public:
|
|||
// issues.
|
||||
class SamplePoint {
|
||||
public:
|
||||
LPoint3f _pos;
|
||||
LVecBase3f _hpr;
|
||||
LPoint3 _pos;
|
||||
LVecBase3 _hpr;
|
||||
double _timestamp;
|
||||
};
|
||||
|
||||
private:
|
||||
SamplePoint _sample;
|
||||
|
||||
LPoint3f _smooth_pos;
|
||||
LVecBase3f _smooth_hpr;
|
||||
LVector3f _forward_axis;
|
||||
LPoint3 _smooth_pos;
|
||||
LVecBase3 _smooth_hpr;
|
||||
LVector3 _forward_axis;
|
||||
double _smooth_timestamp;
|
||||
bool _smooth_position_known;
|
||||
bool _smooth_position_changed;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ d_setSmStop() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmH(float h) {
|
||||
d_setSmH(PN_stdfloat h) {
|
||||
//cout << "d_setSmH: " << h << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmH");
|
||||
|
|
@ -86,7 +86,7 @@ d_setSmH(float h) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmZ(float z) {
|
||||
d_setSmZ(PN_stdfloat z) {
|
||||
//cout << "d_setSmZ: " << z << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmZ");
|
||||
|
|
@ -100,7 +100,7 @@ d_setSmZ(float z) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmXY(float x, float y) {
|
||||
d_setSmXY(PN_stdfloat x, PN_stdfloat y) {
|
||||
//cout << "d_setSmXY: " << x << ", " << y << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmXY");
|
||||
|
|
@ -115,7 +115,7 @@ d_setSmXY(float x, float y) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmXZ(float x, float z) {
|
||||
d_setSmXZ(PN_stdfloat x, PN_stdfloat z) {
|
||||
//cout << "d_setSmXZ: " << x << ", " << z << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmXZ");
|
||||
|
|
@ -130,7 +130,7 @@ d_setSmXZ(float x, float z) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmPos(float x, float y, float z) {
|
||||
d_setSmPos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) {
|
||||
//cout << "d_setSmXYZ: " << x << ", " << y << ", " << z << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmPos");
|
||||
|
|
@ -146,7 +146,7 @@ d_setSmPos(float x, float y, float z) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmHpr(float h, float p, float r) {
|
||||
d_setSmHpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
|
||||
//cout << "d_setSmHPR: " << h << ", " << p << ", " << r << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmHpr");
|
||||
|
|
@ -162,7 +162,7 @@ d_setSmHpr(float h, float p, float r) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmXYH(float x, float y, float h) {
|
||||
d_setSmXYH(PN_stdfloat x, PN_stdfloat y, PN_stdfloat h) {
|
||||
//cout << "d_setSmXYH: " << x << ", " << y << ", " << h << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmXYH");
|
||||
|
|
@ -178,7 +178,7 @@ d_setSmXYH(float x, float y, float h) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmXYZH(float x, float y, float z, float h) {
|
||||
d_setSmXYZH(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h) {
|
||||
//cout << "d_setSmXYZH: " << x << ", " << y << ", " << z << ", " << h << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmXYZH");
|
||||
|
|
@ -195,7 +195,7 @@ d_setSmXYZH(float x, float y, float z, float h) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmPosHpr(float x, float y, float z, float h, float p, float r) {
|
||||
d_setSmPosHpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) {
|
||||
//cout << "d_setSmPosHpr: " << x << ", " << y << ", " << z << ", " << h << ", " << p << ", " << r << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmPosHpr");
|
||||
|
|
@ -215,7 +215,7 @@ d_setSmPosHpr(float x, float y, float z, float h, float p, float r) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CDistributedSmoothNodeBase::
|
||||
d_setSmPosHprL(float x, float y, float z, float h, float p, float r, PN_uint64 l) {
|
||||
d_setSmPosHprL(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_uint64 l) {
|
||||
//cout << "d_setSmPosHprL: " << x << ", " << y << ", " << z << ", " << h << ", " << p << ", " << r << l << endl;
|
||||
DCPacker packer;
|
||||
begin_send_update(packer, "setSmPosHprL");
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#include "dcmsgtypes.h"
|
||||
#include "config_distributed.h"
|
||||
|
||||
static const float smooth_node_epsilon = 0.01;
|
||||
static const PN_stdfloat smooth_node_epsilon = 0.01;
|
||||
static const double network_time_precision = 100.0; // Matches ClockDelta.py
|
||||
|
||||
CConnectionRepository *CDistributedSmoothNodeBase::_repository = NULL;
|
||||
|
|
@ -93,8 +93,8 @@ send_everything() {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
void CDistributedSmoothNodeBase::
|
||||
broadcast_pos_hpr_full() {
|
||||
LPoint3f xyz = _node_path.get_pos();
|
||||
LVecBase3f hpr = _node_path.get_hpr();
|
||||
LPoint3 xyz = _node_path.get_pos();
|
||||
LVecBase3 hpr = _node_path.get_hpr();
|
||||
|
||||
int flags = 0;
|
||||
|
||||
|
|
@ -200,8 +200,8 @@ broadcast_pos_hpr_full() {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
void CDistributedSmoothNodeBase::
|
||||
broadcast_pos_hpr_xyh() {
|
||||
LPoint3f xyz = _node_path.get_pos();
|
||||
LVecBase3f hpr = _node_path.get_hpr();
|
||||
LPoint3 xyz = _node_path.get_pos();
|
||||
LVecBase3 hpr = _node_path.get_hpr();
|
||||
|
||||
int flags = 0;
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ broadcast_pos_hpr_xyh() {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
void CDistributedSmoothNodeBase::
|
||||
broadcast_pos_hpr_xy() {
|
||||
LPoint3f xyz = _node_path.get_pos();
|
||||
LPoint3 xyz = _node_path.get_pos();
|
||||
|
||||
int flags = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,16 +61,16 @@ private:
|
|||
INLINE static bool only_changed(int flags, int compare);
|
||||
|
||||
INLINE void d_setSmStop();
|
||||
INLINE void d_setSmH(float h);
|
||||
INLINE void d_setSmZ(float z);
|
||||
INLINE void d_setSmXY(float x, float y);
|
||||
INLINE void d_setSmXZ(float x, float z);
|
||||
INLINE void d_setSmPos(float x, float y, float z);
|
||||
INLINE void d_setSmHpr(float h, float p, float r);
|
||||
INLINE void d_setSmXYH(float x, float y, float h);
|
||||
INLINE void d_setSmXYZH(float x, float y, float z, float h);
|
||||
INLINE void d_setSmPosHpr(float x, float y, float z, float h, float p, float r);
|
||||
INLINE void d_setSmPosHprL(float x, float y, float z, float h, float p, float r, PN_uint64 l);
|
||||
INLINE void d_setSmH(PN_stdfloat h);
|
||||
INLINE void d_setSmZ(PN_stdfloat z);
|
||||
INLINE void d_setSmXY(PN_stdfloat x, PN_stdfloat y);
|
||||
INLINE void d_setSmXZ(PN_stdfloat x, PN_stdfloat z);
|
||||
INLINE void d_setSmPos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
|
||||
INLINE void d_setSmHpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
|
||||
INLINE void d_setSmXYH(PN_stdfloat x, PN_stdfloat y, PN_stdfloat h);
|
||||
INLINE void d_setSmXYZH(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h);
|
||||
INLINE void d_setSmPosHpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
|
||||
INLINE void d_setSmPosHprL(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_uint64 l);
|
||||
|
||||
void begin_send_update(DCPacker &packer, const string &field_name);
|
||||
void finish_send_update(DCPacker &packer);
|
||||
|
|
@ -95,8 +95,8 @@ private:
|
|||
static PyObject *_clock_delta;
|
||||
#endif
|
||||
|
||||
LPoint3f _store_xyz;
|
||||
LVecBase3f _store_hpr;
|
||||
LPoint3 _store_xyz;
|
||||
LVecBase3 _store_hpr;
|
||||
bool _store_stop;
|
||||
// contains most recently sent location info as
|
||||
// index 0, index 1 contains most recently set location info
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ TypeHandle CConstrainHprInterval::_type_handle;
|
|||
CConstrainHprInterval::
|
||||
CConstrainHprInterval(const string &name, double duration,
|
||||
const NodePath &node, const NodePath &target,
|
||||
bool wrt, const LVecBase3f hprOffset) :
|
||||
bool wrt, const LVecBase3 hprOffset) :
|
||||
CConstraintInterval(name, duration),
|
||||
_node(node),
|
||||
_target(target),
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class EXPCL_DIRECT CConstrainHprInterval : public CConstraintInterval {
|
|||
PUBLISHED:
|
||||
CConstrainHprInterval(const string &name, double duration,
|
||||
const NodePath &node, const NodePath &target,
|
||||
bool wrt, const LVecBase3f hprOffset=LVector3f::zero());
|
||||
bool wrt, const LVecBase3 hprOffset=LVector3::zero());
|
||||
|
||||
INLINE const NodePath &get_node() const;
|
||||
INLINE const NodePath &get_target() const;
|
||||
|
|
@ -42,7 +42,7 @@ private:
|
|||
NodePath _node;
|
||||
NodePath _target;
|
||||
bool _wrt;
|
||||
LQuaternionf _quatOffset;
|
||||
LQuaternion _quatOffset;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ TypeHandle CConstrainPosHprInterval::_type_handle;
|
|||
CConstrainPosHprInterval::
|
||||
CConstrainPosHprInterval(const string &name, double duration,
|
||||
const NodePath &node, const NodePath &target,
|
||||
bool wrt, const LVecBase3f posOffset,
|
||||
const LVecBase3f hprOffset) :
|
||||
bool wrt, const LVecBase3 posOffset,
|
||||
const LVecBase3 hprOffset) :
|
||||
CConstraintInterval(name, duration),
|
||||
_node(node),
|
||||
_target(target),
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ class EXPCL_DIRECT CConstrainPosHprInterval : public CConstraintInterval {
|
|||
PUBLISHED:
|
||||
CConstrainPosHprInterval(const string &name, double duration,
|
||||
const NodePath &node, const NodePath &target,
|
||||
bool wrt, const LVecBase3f posOffset=LVector3f::zero(),
|
||||
const LVecBase3f hprOffset=LVector3f::zero());
|
||||
bool wrt, const LVecBase3 posOffset=LVector3::zero(),
|
||||
const LVecBase3 hprOffset=LVector3::zero());
|
||||
|
||||
INLINE const NodePath &get_node() const;
|
||||
INLINE const NodePath &get_target() const;
|
||||
|
|
@ -44,8 +44,8 @@ private:
|
|||
NodePath _node;
|
||||
NodePath _target;
|
||||
bool _wrt;
|
||||
LVecBase3f _posOffset;
|
||||
LQuaternionf _quatOffset;
|
||||
LVecBase3 _posOffset;
|
||||
LQuaternion _quatOffset;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ TypeHandle CConstrainPosInterval::_type_handle;
|
|||
CConstrainPosInterval::
|
||||
CConstrainPosInterval(const string &name, double duration,
|
||||
const NodePath &node, const NodePath &target,
|
||||
bool wrt, const LVecBase3f posOffset) :
|
||||
bool wrt, const LVecBase3 posOffset) :
|
||||
CConstraintInterval(name, duration),
|
||||
_node(node),
|
||||
_target(target),
|
||||
|
|
@ -66,7 +66,7 @@ priv_step(double t) {
|
|||
}
|
||||
_target.set_pos(_node, _posOffset);
|
||||
} else {
|
||||
if(_posOffset == LVector3f::zero()) {
|
||||
if(_posOffset == LVector3::zero()) {
|
||||
_target.set_pos(_node.get_pos());
|
||||
} else {
|
||||
_target.set_pos(_node.get_pos() + _posOffset);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class EXPCL_DIRECT CConstrainPosInterval : public CConstraintInterval {
|
|||
PUBLISHED:
|
||||
CConstrainPosInterval(const string &name, double duration,
|
||||
const NodePath &node, const NodePath &target,
|
||||
bool wrt, const LVecBase3f posOffset=LVector3f::zero());
|
||||
bool wrt, const LVecBase3 posOffset=LVector3::zero());
|
||||
|
||||
INLINE const NodePath &get_node() const;
|
||||
INLINE const NodePath &get_target() const;
|
||||
|
|
@ -41,7 +41,7 @@ private:
|
|||
NodePath _node;
|
||||
NodePath _target;
|
||||
bool _wrt;
|
||||
LVecBase3f _posOffset;
|
||||
LVecBase3 _posOffset;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ get_other() const {
|
|||
// position at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_pos(const LVecBase3f &pos) {
|
||||
set_start_pos(const LVecBase3 &pos) {
|
||||
nassertv(!pos.is_nan());
|
||||
_start_pos = pos;
|
||||
_flags |= F_start_pos;
|
||||
|
|
@ -62,7 +62,7 @@ set_start_pos(const LVecBase3f &pos) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_pos(const LVecBase3f &pos) {
|
||||
set_end_pos(const LVecBase3 &pos) {
|
||||
nassertv(!pos.is_nan());
|
||||
_end_pos = pos;
|
||||
_flags |= F_end_pos;
|
||||
|
|
@ -79,7 +79,7 @@ set_end_pos(const LVecBase3f &pos) {
|
|||
// is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_hpr(const LVecBase3f &hpr) {
|
||||
set_start_hpr(const LVecBase3 &hpr) {
|
||||
nassertv(!hpr.is_nan());
|
||||
_start_hpr = hpr;
|
||||
_flags = (_flags & ~(F_slerp_setup | F_start_quat)) | F_start_hpr;
|
||||
|
|
@ -97,7 +97,7 @@ set_start_hpr(const LVecBase3f &hpr) {
|
|||
// the node's rotation will not be affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_hpr(const LVecBase3f &hpr) {
|
||||
set_end_hpr(const LVecBase3 &hpr) {
|
||||
nassertv(!hpr.is_nan());
|
||||
_end_hpr = hpr;
|
||||
_flags = (_flags & ~F_end_quat) | F_end_hpr;
|
||||
|
|
@ -117,7 +117,7 @@ set_end_hpr(const LVecBase3f &hpr) {
|
|||
// performed in HPR space, componentwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_hpr(const LQuaternionf &quat) {
|
||||
set_end_hpr(const LQuaternion &quat) {
|
||||
nassertv(!quat.is_nan());
|
||||
_end_hpr = quat.get_hpr();
|
||||
_flags = (_flags & ~F_end_quat) | F_end_hpr;
|
||||
|
|
@ -134,7 +134,7 @@ set_end_hpr(const LQuaternionf &quat) {
|
|||
// is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_quat(const LQuaternionf &quat) {
|
||||
set_start_quat(const LQuaternion &quat) {
|
||||
nassertv(!quat.is_nan());
|
||||
_start_quat = quat;
|
||||
_flags = (_flags & ~(F_slerp_setup | F_start_hpr)) | F_start_quat;
|
||||
|
|
@ -158,7 +158,7 @@ set_start_quat(const LQuaternionf &quat) {
|
|||
// quaternion space, as a spherical lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_quat(const LVecBase3f &hpr) {
|
||||
set_end_quat(const LVecBase3 &hpr) {
|
||||
nassertv(!hpr.is_nan());
|
||||
_end_quat.set_hpr(hpr);
|
||||
_flags = (_flags & ~(F_slerp_setup | F_end_hpr)) | F_end_quat;
|
||||
|
|
@ -176,7 +176,7 @@ set_end_quat(const LVecBase3f &hpr) {
|
|||
// the node's rotation will not be affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_quat(const LQuaternionf &quat) {
|
||||
set_end_quat(const LQuaternion &quat) {
|
||||
nassertv(!quat.is_nan());
|
||||
_end_quat = quat;
|
||||
_flags = (_flags & ~(F_slerp_setup | F_end_hpr)) | F_end_quat;
|
||||
|
|
@ -192,7 +192,7 @@ set_end_quat(const LQuaternionf &quat) {
|
|||
// scale at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_scale(const LVecBase3f &scale) {
|
||||
set_start_scale(const LVecBase3 &scale) {
|
||||
nassertv(!scale.is_nan());
|
||||
_start_scale = scale;
|
||||
_flags |= F_start_scale;
|
||||
|
|
@ -208,9 +208,9 @@ set_start_scale(const LVecBase3f &scale) {
|
|||
// scale at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_scale(float scale) {
|
||||
set_start_scale(PN_stdfloat scale) {
|
||||
nassertv(!cnan(scale));
|
||||
set_start_scale(LVecBase3f(scale, scale, scale));
|
||||
set_start_scale(LVecBase3(scale, scale, scale));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -223,7 +223,7 @@ set_start_scale(float scale) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_scale(const LVecBase3f &scale) {
|
||||
set_end_scale(const LVecBase3 &scale) {
|
||||
nassertv(!scale.is_nan());
|
||||
_end_scale = scale;
|
||||
_flags |= F_end_scale;
|
||||
|
|
@ -239,9 +239,9 @@ set_end_scale(const LVecBase3f &scale) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_scale(float scale) {
|
||||
set_end_scale(PN_stdfloat scale) {
|
||||
nassertv(!cnan(scale));
|
||||
set_end_scale(LVecBase3f(scale, scale, scale));
|
||||
set_end_scale(LVecBase3(scale, scale, scale));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -254,7 +254,7 @@ set_end_scale(float scale) {
|
|||
// shear at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_shear(const LVecBase3f &shear) {
|
||||
set_start_shear(const LVecBase3 &shear) {
|
||||
nassertv(!shear.is_nan());
|
||||
_start_shear = shear;
|
||||
_flags |= F_start_shear;
|
||||
|
|
@ -270,7 +270,7 @@ set_start_shear(const LVecBase3f &shear) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_shear(const LVecBase3f &shear) {
|
||||
set_end_shear(const LVecBase3 &shear) {
|
||||
nassertv(!shear.is_nan());
|
||||
_end_shear = shear;
|
||||
_flags |= F_end_shear;
|
||||
|
|
@ -286,7 +286,7 @@ set_end_shear(const LVecBase3f &shear) {
|
|||
// color at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_color(const LVecBase4f &color) {
|
||||
set_start_color(const LVecBase4 &color) {
|
||||
nassertv(!color.is_nan());
|
||||
_start_color = color;
|
||||
_flags |= F_start_color;
|
||||
|
|
@ -302,7 +302,7 @@ set_start_color(const LVecBase4f &color) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_color(const LVecBase4f &color) {
|
||||
set_end_color(const LVecBase4 &color) {
|
||||
nassertv(!color.is_nan());
|
||||
_end_color = color;
|
||||
_flags |= F_end_color;
|
||||
|
|
@ -318,7 +318,7 @@ set_end_color(const LVecBase4f &color) {
|
|||
// color scale at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_color_scale(const LVecBase4f &color_scale) {
|
||||
set_start_color_scale(const LVecBase4 &color_scale) {
|
||||
nassertv(!color_scale.is_nan());
|
||||
_start_color_scale = color_scale;
|
||||
_flags |= F_start_color_scale;
|
||||
|
|
@ -334,7 +334,7 @@ set_start_color_scale(const LVecBase4f &color_scale) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_color_scale(const LVecBase4f &color_scale) {
|
||||
set_end_color_scale(const LVecBase4 &color_scale) {
|
||||
nassertv(!color_scale.is_nan());
|
||||
_end_color_scale = color_scale;
|
||||
_flags |= F_end_color_scale;
|
||||
|
|
@ -362,7 +362,7 @@ set_texture_stage(TextureStage *stage) {
|
|||
// UV offset at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_tex_offset(const LVecBase2f &tex_offset) {
|
||||
set_start_tex_offset(const LVecBase2 &tex_offset) {
|
||||
nassertv(!tex_offset.is_nan());
|
||||
_start_tex_offset = tex_offset;
|
||||
_flags |= F_start_tex_offset;
|
||||
|
|
@ -378,7 +378,7 @@ set_start_tex_offset(const LVecBase2f &tex_offset) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_tex_offset(const LVecBase2f &tex_offset) {
|
||||
set_end_tex_offset(const LVecBase2 &tex_offset) {
|
||||
nassertv(!tex_offset.is_nan());
|
||||
_end_tex_offset = tex_offset;
|
||||
_flags |= F_end_tex_offset;
|
||||
|
|
@ -394,7 +394,7 @@ set_end_tex_offset(const LVecBase2f &tex_offset) {
|
|||
// UV rotate at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_tex_rotate(float tex_rotate) {
|
||||
set_start_tex_rotate(PN_stdfloat tex_rotate) {
|
||||
nassertv(!cnan(tex_rotate));
|
||||
_start_tex_rotate = tex_rotate;
|
||||
_flags |= F_start_tex_rotate;
|
||||
|
|
@ -410,7 +410,7 @@ set_start_tex_rotate(float tex_rotate) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_tex_rotate(float tex_rotate) {
|
||||
set_end_tex_rotate(PN_stdfloat tex_rotate) {
|
||||
nassertv(!cnan(tex_rotate));
|
||||
_end_tex_rotate = tex_rotate;
|
||||
_flags |= F_end_tex_rotate;
|
||||
|
|
@ -426,7 +426,7 @@ set_end_tex_rotate(float tex_rotate) {
|
|||
// UV scale at the time the lerp is performed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_start_tex_scale(const LVecBase2f &tex_scale) {
|
||||
set_start_tex_scale(const LVecBase2 &tex_scale) {
|
||||
nassertv(!tex_scale.is_nan());
|
||||
_start_tex_scale = tex_scale;
|
||||
_flags |= F_start_tex_scale;
|
||||
|
|
@ -442,7 +442,7 @@ set_start_tex_scale(const LVecBase2f &tex_scale) {
|
|||
// affected by the lerp.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CLerpNodePathInterval::
|
||||
set_end_tex_scale(const LVecBase2f &tex_scale) {
|
||||
set_end_tex_scale(const LVecBase2 &tex_scale) {
|
||||
nassertv(!tex_scale.is_nan());
|
||||
_end_tex_scale = tex_scale;
|
||||
_flags |= F_end_tex_scale;
|
||||
|
|
|
|||
|
|
@ -141,11 +141,11 @@ priv_step(double t) {
|
|||
transform = _node.get_transform(_other);
|
||||
}
|
||||
|
||||
LPoint3f pos;
|
||||
LVecBase3f hpr;
|
||||
LQuaternionf quat;
|
||||
LVecBase3f scale;
|
||||
LVecBase3f shear;
|
||||
LPoint3 pos;
|
||||
LVecBase3 hpr;
|
||||
LQuaternion quat;
|
||||
LVecBase3 scale;
|
||||
LVecBase3 shear;
|
||||
|
||||
if ((_flags & F_end_pos) != 0) {
|
||||
if ((_flags & F_start_pos) != 0) {
|
||||
|
|
@ -198,7 +198,7 @@ priv_step(double t) {
|
|||
if (_prev_d == 1.0) {
|
||||
_start_quat = _end_quat;
|
||||
} else {
|
||||
LQuaternionf prev_value = transform->get_quat();
|
||||
LQuaternion prev_value = transform->get_quat();
|
||||
_start_quat = (prev_value - _prev_d * _end_quat) / (1.0 - _prev_d);
|
||||
}
|
||||
setup_slerp();
|
||||
|
|
@ -412,7 +412,7 @@ priv_step(double t) {
|
|||
// attributes don't interrelate.
|
||||
|
||||
if ((_flags & F_end_color) != 0) {
|
||||
Colorf color;
|
||||
LColor color;
|
||||
|
||||
if ((_flags & F_start_color) != 0) {
|
||||
lerp_value(color, d, _start_color, _end_color);
|
||||
|
|
@ -436,7 +436,7 @@ priv_step(double t) {
|
|||
}
|
||||
|
||||
if ((_flags & F_end_color_scale) != 0) {
|
||||
LVecBase4f color_scale;
|
||||
LVecBase4 color_scale;
|
||||
|
||||
if ((_flags & F_start_color_scale) != 0) {
|
||||
lerp_value(color_scale, d, _start_color_scale, _end_color_scale);
|
||||
|
|
@ -472,7 +472,7 @@ priv_step(double t) {
|
|||
}
|
||||
|
||||
if ((_flags & F_end_tex_offset) != 0) {
|
||||
LVecBase2f tex_offset;
|
||||
LVecBase2 tex_offset;
|
||||
|
||||
if ((_flags & F_start_tex_offset) != 0) {
|
||||
lerp_value(tex_offset, d, _start_tex_offset, _end_tex_offset);
|
||||
|
|
@ -486,7 +486,7 @@ priv_step(double t) {
|
|||
}
|
||||
|
||||
if ((_flags & F_end_tex_rotate) != 0) {
|
||||
float tex_rotate;
|
||||
PN_stdfloat tex_rotate;
|
||||
|
||||
if ((_flags & F_start_tex_rotate) != 0) {
|
||||
lerp_value(tex_rotate, d, _start_tex_rotate, _end_tex_rotate);
|
||||
|
|
@ -500,7 +500,7 @@ priv_step(double t) {
|
|||
}
|
||||
|
||||
if ((_flags & F_end_tex_scale) != 0) {
|
||||
LVecBase2f tex_scale;
|
||||
LVecBase2 tex_scale;
|
||||
|
||||
if ((_flags & F_start_tex_scale) != 0) {
|
||||
lerp_value(tex_scale, d, _start_tex_scale, _end_tex_scale);
|
||||
|
|
@ -691,11 +691,11 @@ setup_slerp() {
|
|||
// quaternions is not near one extreme or the other.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLerpNodePathInterval::
|
||||
slerp_basic(LQuaternionf &result, float t) const {
|
||||
slerp_basic(LQuaternion &result, PN_stdfloat t) const {
|
||||
nassertv(_slerp_denom != 0.0f);
|
||||
float ti = 1.0f - t;
|
||||
float ta = t * _slerp_angle;
|
||||
float tia = ti * _slerp_angle;
|
||||
PN_stdfloat ti = 1.0f - t;
|
||||
PN_stdfloat ta = t * _slerp_angle;
|
||||
PN_stdfloat tia = ti * _slerp_angle;
|
||||
|
||||
if (interval_cat.is_spam()) {
|
||||
interval_cat.spam()
|
||||
|
|
@ -716,11 +716,11 @@ slerp_basic(LQuaternionf &result, float t) const {
|
|||
// quaternions approaches zero.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLerpNodePathInterval::
|
||||
slerp_angle_0(LQuaternionf &result, float t) const {
|
||||
slerp_angle_0(LQuaternion &result, PN_stdfloat t) const {
|
||||
nassertv(_slerp_denom != 0.0f);
|
||||
float ti = 1.0f - t;
|
||||
float ta = t * _slerp_angle;
|
||||
float tia = ti * _slerp_angle;
|
||||
PN_stdfloat ti = 1.0f - t;
|
||||
PN_stdfloat ta = t * _slerp_angle;
|
||||
PN_stdfloat tia = ti * _slerp_angle;
|
||||
|
||||
if (interval_cat.is_spam()) {
|
||||
interval_cat.spam()
|
||||
|
|
@ -742,16 +742,16 @@ slerp_angle_0(LQuaternionf &result, float t) const {
|
|||
// the quaternions approaches 180 degrees.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLerpNodePathInterval::
|
||||
slerp_angle_180(LQuaternionf &result, float t) const {
|
||||
slerp_angle_180(LQuaternion &result, PN_stdfloat t) const {
|
||||
nassertv(_slerp_denom != 0.0f);
|
||||
if (t < 0.5) {
|
||||
// The first half of the lerp: _start_quat to _slerp_c.
|
||||
|
||||
t *= 2.0f;
|
||||
|
||||
float ti = 1.0f - t;
|
||||
float ta = t * _slerp_angle;
|
||||
float tia = ti * _slerp_angle;
|
||||
PN_stdfloat ti = 1.0f - t;
|
||||
PN_stdfloat ta = t * _slerp_angle;
|
||||
PN_stdfloat tia = ti * _slerp_angle;
|
||||
|
||||
if (interval_cat.is_spam()) {
|
||||
interval_cat.spam()
|
||||
|
|
@ -767,9 +767,9 @@ slerp_angle_180(LQuaternionf &result, float t) const {
|
|||
// The second half of the lerp: _slerp_c to _end_quat.
|
||||
t = t * 2.0f - 1.0f;
|
||||
|
||||
float ti = 1.0f - t;
|
||||
float ta = t * _slerp_angle;
|
||||
float tia = ti * _slerp_angle;
|
||||
PN_stdfloat ti = 1.0f - t;
|
||||
PN_stdfloat ta = t * _slerp_angle;
|
||||
PN_stdfloat tia = ti * _slerp_angle;
|
||||
|
||||
if (interval_cat.is_spam()) {
|
||||
interval_cat.spam()
|
||||
|
|
|
|||
|
|
@ -35,31 +35,31 @@ PUBLISHED:
|
|||
INLINE const NodePath &get_node() const;
|
||||
INLINE const NodePath &get_other() const;
|
||||
|
||||
INLINE void set_start_pos(const LVecBase3f &pos);
|
||||
INLINE void set_end_pos(const LVecBase3f &pos);
|
||||
INLINE void set_start_hpr(const LVecBase3f &hpr);
|
||||
INLINE void set_end_hpr(const LVecBase3f &hpr);
|
||||
INLINE void set_end_hpr(const LQuaternionf &quat);
|
||||
INLINE void set_start_quat(const LQuaternionf &quat);
|
||||
INLINE void set_end_quat(const LVecBase3f &hpr);
|
||||
INLINE void set_end_quat(const LQuaternionf &quat);
|
||||
INLINE void set_start_scale(const LVecBase3f &scale);
|
||||
INLINE void set_start_scale(float scale);
|
||||
INLINE void set_end_scale(const LVecBase3f &scale);
|
||||
INLINE void set_end_scale(float scale);
|
||||
INLINE void set_start_shear(const LVecBase3f &shear);
|
||||
INLINE void set_end_shear(const LVecBase3f &shear);
|
||||
INLINE void set_start_color(const LVecBase4f &color);
|
||||
INLINE void set_end_color(const LVecBase4f &color);
|
||||
INLINE void set_start_color_scale(const LVecBase4f &color_scale);
|
||||
INLINE void set_end_color_scale(const LVecBase4f &color_scale);
|
||||
INLINE void set_start_pos(const LVecBase3 &pos);
|
||||
INLINE void set_end_pos(const LVecBase3 &pos);
|
||||
INLINE void set_start_hpr(const LVecBase3 &hpr);
|
||||
INLINE void set_end_hpr(const LVecBase3 &hpr);
|
||||
INLINE void set_end_hpr(const LQuaternion &quat);
|
||||
INLINE void set_start_quat(const LQuaternion &quat);
|
||||
INLINE void set_end_quat(const LVecBase3 &hpr);
|
||||
INLINE void set_end_quat(const LQuaternion &quat);
|
||||
INLINE void set_start_scale(const LVecBase3 &scale);
|
||||
INLINE void set_start_scale(PN_stdfloat scale);
|
||||
INLINE void set_end_scale(const LVecBase3 &scale);
|
||||
INLINE void set_end_scale(PN_stdfloat scale);
|
||||
INLINE void set_start_shear(const LVecBase3 &shear);
|
||||
INLINE void set_end_shear(const LVecBase3 &shear);
|
||||
INLINE void set_start_color(const LVecBase4 &color);
|
||||
INLINE void set_end_color(const LVecBase4 &color);
|
||||
INLINE void set_start_color_scale(const LVecBase4 &color_scale);
|
||||
INLINE void set_end_color_scale(const LVecBase4 &color_scale);
|
||||
INLINE void set_texture_stage(TextureStage *stage);
|
||||
INLINE void set_start_tex_offset(const LVecBase2f &tex_offset);
|
||||
INLINE void set_end_tex_offset(const LVecBase2f &tex_offset);
|
||||
INLINE void set_start_tex_rotate(float tex_rotate);
|
||||
INLINE void set_end_tex_rotate(float tex_rotate);
|
||||
INLINE void set_start_tex_scale(const LVecBase2f &tex_scale);
|
||||
INLINE void set_end_tex_scale(const LVecBase2f &tex_scale);
|
||||
INLINE void set_start_tex_offset(const LVecBase2 &tex_offset);
|
||||
INLINE void set_end_tex_offset(const LVecBase2 &tex_offset);
|
||||
INLINE void set_start_tex_rotate(PN_stdfloat tex_rotate);
|
||||
INLINE void set_end_tex_rotate(PN_stdfloat tex_rotate);
|
||||
INLINE void set_start_tex_scale(const LVecBase2 &tex_scale);
|
||||
INLINE void set_end_tex_scale(const LVecBase2 &tex_scale);
|
||||
|
||||
INLINE void set_override(int override);
|
||||
INLINE int get_override() const;
|
||||
|
|
@ -108,30 +108,30 @@ private:
|
|||
};
|
||||
|
||||
unsigned int _flags;
|
||||
LPoint3f _start_pos, _end_pos;
|
||||
LVecBase3f _start_hpr, _end_hpr;
|
||||
LQuaternionf _start_quat, _end_quat;
|
||||
LVecBase3f _start_scale, _end_scale;
|
||||
LVecBase3f _start_shear, _end_shear;
|
||||
Colorf _start_color, _end_color;
|
||||
LVecBase4f _start_color_scale, _end_color_scale;
|
||||
LPoint3 _start_pos, _end_pos;
|
||||
LVecBase3 _start_hpr, _end_hpr;
|
||||
LQuaternion _start_quat, _end_quat;
|
||||
LVecBase3 _start_scale, _end_scale;
|
||||
LVecBase3 _start_shear, _end_shear;
|
||||
LColor _start_color, _end_color;
|
||||
LVecBase4 _start_color_scale, _end_color_scale;
|
||||
PT(TextureStage) _texture_stage;
|
||||
LVecBase2f _start_tex_offset, _end_tex_offset;
|
||||
float _start_tex_rotate, _end_tex_rotate;
|
||||
LVecBase2f _start_tex_scale, _end_tex_scale;
|
||||
LVecBase2 _start_tex_offset, _end_tex_offset;
|
||||
PN_stdfloat _start_tex_rotate, _end_tex_rotate;
|
||||
LVecBase2 _start_tex_scale, _end_tex_scale;
|
||||
|
||||
int _override;
|
||||
double _prev_d;
|
||||
float _slerp_angle;
|
||||
float _slerp_denom;
|
||||
LQuaternionf _slerp_c;
|
||||
PN_stdfloat _slerp_angle;
|
||||
PN_stdfloat _slerp_denom;
|
||||
LQuaternion _slerp_c;
|
||||
|
||||
void slerp_basic(LQuaternionf &result, float t) const;
|
||||
void slerp_angle_0(LQuaternionf &result, float t) const;
|
||||
void slerp_angle_180(LQuaternionf &result, float t) const;
|
||||
void slerp_basic(LQuaternion &result, PN_stdfloat t) const;
|
||||
void slerp_angle_0(LQuaternion &result, PN_stdfloat t) const;
|
||||
void slerp_angle_180(LQuaternion &result, PN_stdfloat t) const;
|
||||
|
||||
// Define a pointer to one of the above three methods.
|
||||
void (CLerpNodePathInterval::*_slerp)(LQuaternionf &result, float t) const;
|
||||
void (CLerpNodePathInterval::*_slerp)(LQuaternion &result, PN_stdfloat t) const;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ set_geom_node (PT(GeomNode) geom_node) {
|
|||
// Description: Add a vertex.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CMotionTrail::
|
||||
add_vertex (LVector4f *vertex, LVector4f *start_color, LVector4f *end_color, float v) {
|
||||
add_vertex (LVector4 *vertex, LVector4 *start_color, LVector4 *end_color, PN_stdfloat v) {
|
||||
|
||||
CMotionTrailVertex motion_trail_vertex;
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ add_vertex (LVector4f *vertex, LVector4f *start_color, LVector4f *end_color, flo
|
|||
// Applicable only if nurbs is on.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CMotionTrail::
|
||||
set_parameters (float sampling_time, float time_window, bool use_texture, bool calculate_relative_matrix, bool use_nurbs, float resolution_distance) {
|
||||
set_parameters (PN_stdfloat sampling_time, PN_stdfloat time_window, bool use_texture, bool calculate_relative_matrix, bool use_nurbs, PN_stdfloat resolution_distance) {
|
||||
|
||||
_sampling_time = sampling_time;
|
||||
_time_window = time_window;
|
||||
|
|
@ -180,7 +180,7 @@ set_parameters (float sampling_time, float time_window, bool use_texture, bool c
|
|||
// Description: Check if a sample can be submitted.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
int CMotionTrail::
|
||||
check_for_update (float current_time) {
|
||||
check_for_update (PN_stdfloat current_time) {
|
||||
|
||||
int state;
|
||||
|
||||
|
|
@ -196,7 +196,7 @@ check_for_update (float current_time) {
|
|||
return state;
|
||||
}
|
||||
|
||||
float one_minus_x (float x) {
|
||||
PN_stdfloat one_minus_x (PN_stdfloat x) {
|
||||
x = 1.0 - x;
|
||||
if (x < 0.0) {
|
||||
x = 0.0;
|
||||
|
|
@ -243,26 +243,26 @@ begin_geometry ( ) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CMotionTrail::add_geometry_quad
|
||||
// Access: Public
|
||||
// Description: LVector3f vertex version.
|
||||
// Description: LVector3 vertex version.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CMotionTrail::
|
||||
add_geometry_quad (LVector3f &v0, LVector3f &v1, LVector3f &v2, LVector3f &v3, LVector4f &c0, LVector4f &c1, LVector4f &c2, LVector4f &c3, LVector2f &t0, LVector2f &t1, LVector2f &t2, LVector2f &t3) {
|
||||
add_geometry_quad (LVector3 &v0, LVector3 &v1, LVector3 &v2, LVector3 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3) {
|
||||
|
||||
_vertex_writer.add_data3f (v0);
|
||||
_vertex_writer.add_data3f (v1);
|
||||
_vertex_writer.add_data3f (v2);
|
||||
_vertex_writer.add_data3f (v3);
|
||||
_vertex_writer.add_data3 (v0);
|
||||
_vertex_writer.add_data3 (v1);
|
||||
_vertex_writer.add_data3 (v2);
|
||||
_vertex_writer.add_data3 (v3);
|
||||
|
||||
_color_writer.add_data4f (c0);
|
||||
_color_writer.add_data4f (c1);
|
||||
_color_writer.add_data4f (c2);
|
||||
_color_writer.add_data4f (c3);
|
||||
_color_writer.add_data4 (c0);
|
||||
_color_writer.add_data4 (c1);
|
||||
_color_writer.add_data4 (c2);
|
||||
_color_writer.add_data4 (c3);
|
||||
|
||||
if (_use_texture) {
|
||||
_texture_writer.add_data2f (t0);
|
||||
_texture_writer.add_data2f (t1);
|
||||
_texture_writer.add_data2f (t2);
|
||||
_texture_writer.add_data2f (t3);
|
||||
_texture_writer.add_data2 (t0);
|
||||
_texture_writer.add_data2 (t1);
|
||||
_texture_writer.add_data2 (t2);
|
||||
_texture_writer.add_data2 (t3);
|
||||
}
|
||||
|
||||
int vertex_index;
|
||||
|
|
@ -284,26 +284,26 @@ add_geometry_quad (LVector3f &v0, LVector3f &v1, LVector3f &v2, LVector3f &v3, L
|
|||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CMotionTrail::add_geometry_quad
|
||||
// Access: Public
|
||||
// Description: LVector4f vertex version.
|
||||
// Description: LVector4 vertex version.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CMotionTrail::
|
||||
add_geometry_quad (LVector4f &v0, LVector4f &v1, LVector4f &v2, LVector4f &v3, LVector4f &c0, LVector4f &c1, LVector4f &c2, LVector4f &c3, LVector2f &t0, LVector2f &t1, LVector2f &t2, LVector2f &t3) {
|
||||
add_geometry_quad (LVector4 &v0, LVector4 &v1, LVector4 &v2, LVector4 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3) {
|
||||
|
||||
_vertex_writer.add_data3f (v0 [0], v0 [1], v0 [2]);
|
||||
_vertex_writer.add_data3f (v1 [0], v1 [1], v1 [2]);
|
||||
_vertex_writer.add_data3f (v2 [0], v2 [1], v2 [2]);
|
||||
_vertex_writer.add_data3f (v3 [0], v3 [1], v3 [2]);
|
||||
_vertex_writer.add_data3 (v0 [0], v0 [1], v0 [2]);
|
||||
_vertex_writer.add_data3 (v1 [0], v1 [1], v1 [2]);
|
||||
_vertex_writer.add_data3 (v2 [0], v2 [1], v2 [2]);
|
||||
_vertex_writer.add_data3 (v3 [0], v3 [1], v3 [2]);
|
||||
|
||||
_color_writer.add_data4f (c0);
|
||||
_color_writer.add_data4f (c1);
|
||||
_color_writer.add_data4f (c2);
|
||||
_color_writer.add_data4f (c3);
|
||||
_color_writer.add_data4 (c0);
|
||||
_color_writer.add_data4 (c1);
|
||||
_color_writer.add_data4 (c2);
|
||||
_color_writer.add_data4 (c3);
|
||||
|
||||
if (_use_texture) {
|
||||
_texture_writer.add_data2f (t0);
|
||||
_texture_writer.add_data2f (t1);
|
||||
_texture_writer.add_data2f (t2);
|
||||
_texture_writer.add_data2f (t3);
|
||||
_texture_writer.add_data2 (t0);
|
||||
_texture_writer.add_data2 (t1);
|
||||
_texture_writer.add_data2 (t2);
|
||||
_texture_writer.add_data2 (t3);
|
||||
}
|
||||
|
||||
int vertex_index;
|
||||
|
|
@ -350,7 +350,7 @@ void CMotionTrail::end_geometry ( ) {
|
|||
// Description: See class header comments.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CMotionTrail::
|
||||
update_motion_trail (float current_time, LMatrix4f *transform) {
|
||||
update_motion_trail (PN_stdfloat current_time, LMatrix4 *transform) {
|
||||
|
||||
int debug;
|
||||
int total_frames;
|
||||
|
|
@ -371,15 +371,15 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
}
|
||||
|
||||
int total_vertices;
|
||||
float color_scale;
|
||||
LMatrix4f start_transform;
|
||||
LMatrix4f end_transform;
|
||||
LMatrix4f inverse_matrix;
|
||||
PN_stdfloat color_scale;
|
||||
LMatrix4 start_transform;
|
||||
LMatrix4 end_transform;
|
||||
LMatrix4 inverse_matrix;
|
||||
|
||||
total_vertices = _vertex_list.size ( );
|
||||
color_scale = _color_scale;
|
||||
if (_fade) {
|
||||
float elapsed_time;
|
||||
PN_stdfloat elapsed_time;
|
||||
|
||||
elapsed_time = current_time - _fade_start_time;
|
||||
if (elapsed_time < 0.0) {
|
||||
|
|
@ -397,7 +397,7 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
_last_update_time = current_time;
|
||||
|
||||
// remove expired frames
|
||||
float minimum_time;
|
||||
PN_stdfloat minimum_time;
|
||||
|
||||
minimum_time = current_time - _time_window;
|
||||
|
||||
|
|
@ -431,8 +431,8 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
|
||||
if ((total_frames >= 2) && (total_vertices >= 2)) {
|
||||
int total_segments;
|
||||
float minimum_time;
|
||||
float delta_time;
|
||||
PN_stdfloat minimum_time;
|
||||
PN_stdfloat delta_time;
|
||||
CMotionTrailFrame last_motion_trail_frame;
|
||||
|
||||
list <CMotionTrailVertex>::iterator vertex_iterator;
|
||||
|
|
@ -463,13 +463,13 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
|
||||
// nurbs version
|
||||
int total_vertex_segments;
|
||||
float total_distance;
|
||||
LVector3f vector;
|
||||
LVector4f v;
|
||||
LVector4f v0;
|
||||
LVector4f v1;
|
||||
LVector4f v2;
|
||||
LVector4f v3;
|
||||
PN_stdfloat total_distance;
|
||||
LVector3 vector;
|
||||
LVector4 v;
|
||||
LVector4 v0;
|
||||
LVector4 v1;
|
||||
LVector4 v2;
|
||||
LVector4 v3;
|
||||
|
||||
total_vertex_segments = total_vertices - 1;
|
||||
total_distance = 0.0f;
|
||||
|
|
@ -536,7 +536,7 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
|
||||
nurbs_curve_evaluator -> set_vertex (segment_index, v1);
|
||||
if (vertex_segement_index == (total_vertex_segments - 1)) {
|
||||
float distance;
|
||||
PN_stdfloat distance;
|
||||
|
||||
v = v1 - v3;
|
||||
vector.set (v[0], v[1], v[2]);
|
||||
|
|
@ -567,8 +567,8 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
nurbs_curve_result_array [index] = nurbs_curve_result;
|
||||
|
||||
if (debug) {
|
||||
float nurbs_start_t;
|
||||
float nurbs_end_t;
|
||||
PN_stdfloat nurbs_start_t;
|
||||
PN_stdfloat nurbs_end_t;
|
||||
|
||||
nurbs_start_t = nurbs_curve_result -> get_start_t();
|
||||
nurbs_end_t = nurbs_curve_result -> get_end_t();
|
||||
|
|
@ -578,7 +578,7 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
}
|
||||
|
||||
// create quads from NurbsCurveResult
|
||||
float total_curve_segments;
|
||||
PN_stdfloat total_curve_segments;
|
||||
|
||||
total_curve_segments = (total_distance / _resolution_distance);
|
||||
if (total_curve_segments < total_segments) {
|
||||
|
|
@ -586,35 +586,35 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
}
|
||||
|
||||
{
|
||||
LVector3f v0;
|
||||
LVector3f v1;
|
||||
LVector3f v2;
|
||||
LVector3f v3;
|
||||
LVector3 v0;
|
||||
LVector3 v1;
|
||||
LVector3 v2;
|
||||
LVector3 v3;
|
||||
|
||||
LVector4f c0;
|
||||
LVector4f c1;
|
||||
LVector4f c2;
|
||||
LVector4f c3;
|
||||
LVector4 c0;
|
||||
LVector4 c1;
|
||||
LVector4 c2;
|
||||
LVector4 c3;
|
||||
|
||||
LVector2f t0;
|
||||
LVector2f t1;
|
||||
LVector2f t2;
|
||||
LVector2f t3;
|
||||
LVector2 t0;
|
||||
LVector2 t1;
|
||||
LVector2 t2;
|
||||
LVector2 t3;
|
||||
|
||||
LVector4f vertex_start_color;
|
||||
LVector4f vertex_end_color;
|
||||
LVector4 vertex_start_color;
|
||||
LVector4 vertex_end_color;
|
||||
|
||||
float curve_segment_index;
|
||||
PN_stdfloat curve_segment_index;
|
||||
|
||||
curve_segment_index = 0.0;
|
||||
while (curve_segment_index < total_curve_segments) {
|
||||
|
||||
float st;
|
||||
float et;
|
||||
float start_t;
|
||||
float end_t;
|
||||
float color_start_t;
|
||||
float color_end_t;
|
||||
PN_stdfloat st;
|
||||
PN_stdfloat et;
|
||||
PN_stdfloat start_t;
|
||||
PN_stdfloat end_t;
|
||||
PN_stdfloat color_start_t;
|
||||
PN_stdfloat color_end_t;
|
||||
|
||||
int vertex_segement_index;
|
||||
|
||||
|
|
@ -651,10 +651,10 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
|
||||
while (vertex_segement_index < total_vertex_segments) {
|
||||
|
||||
float start_nurbs_start_t;
|
||||
float start_nurbs_end_t;
|
||||
float end_nurbs_start_t;
|
||||
float end_nurbs_end_t;
|
||||
PN_stdfloat start_nurbs_start_t;
|
||||
PN_stdfloat start_nurbs_end_t;
|
||||
PN_stdfloat end_nurbs_start_t;
|
||||
PN_stdfloat end_nurbs_end_t;
|
||||
|
||||
motion_trail_vertex_start = &_vertex_array [vertex_segement_index];
|
||||
motion_trail_vertex_end = &_vertex_array [vertex_segement_index + 1];
|
||||
|
|
@ -667,8 +667,8 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
end_nurbs_start_t = end_nurbs_curve_result -> get_start_t();
|
||||
end_nurbs_end_t = end_nurbs_curve_result -> get_end_t();
|
||||
|
||||
float start_delta_t;
|
||||
float end_delta_t;
|
||||
PN_stdfloat start_delta_t;
|
||||
PN_stdfloat end_delta_t;
|
||||
|
||||
start_delta_t = (start_nurbs_end_t - start_nurbs_start_t);
|
||||
end_delta_t = (end_nurbs_end_t - end_nurbs_start_t);
|
||||
|
|
@ -718,30 +718,30 @@ update_motion_trail (float current_time, LMatrix4f *transform) {
|
|||
int vertex_segment_index;
|
||||
int total_vertex_segments;
|
||||
|
||||
float st;
|
||||
float et;
|
||||
float start_t;
|
||||
float end_t;
|
||||
float color_start_t;
|
||||
float color_end_t;
|
||||
PN_stdfloat st;
|
||||
PN_stdfloat et;
|
||||
PN_stdfloat start_t;
|
||||
PN_stdfloat end_t;
|
||||
PN_stdfloat color_start_t;
|
||||
PN_stdfloat color_end_t;
|
||||
|
||||
LVector4f v0;
|
||||
LVector4f v1;
|
||||
LVector4f v2;
|
||||
LVector4f v3;
|
||||
LVector4 v0;
|
||||
LVector4 v1;
|
||||
LVector4 v2;
|
||||
LVector4 v3;
|
||||
|
||||
LVector4f c0;
|
||||
LVector4f c1;
|
||||
LVector4f c2;
|
||||
LVector4f c3;
|
||||
LVector4 c0;
|
||||
LVector4 c1;
|
||||
LVector4 c2;
|
||||
LVector4 c3;
|
||||
|
||||
LVector2f t0;
|
||||
LVector2f t1;
|
||||
LVector2f t2;
|
||||
LVector2f t3;
|
||||
LVector2 t0;
|
||||
LVector2 t1;
|
||||
LVector2 t2;
|
||||
LVector2 t3;
|
||||
|
||||
LVector4f vertex_start_color;
|
||||
LVector4f vertex_end_color;
|
||||
LVector4 vertex_start_color;
|
||||
LVector4 vertex_end_color;
|
||||
|
||||
CMotionTrailFrame motion_trail_frame_start;
|
||||
CMotionTrailFrame motion_trail_frame_end;
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@
|
|||
class CMotionTrailVertex {
|
||||
|
||||
public:
|
||||
LVector4f _vertex;
|
||||
LVector4f _start_color;
|
||||
LVector4f _end_color;
|
||||
float _v;
|
||||
LVector4 _vertex;
|
||||
LVector4 _start_color;
|
||||
LVector4 _end_color;
|
||||
PN_stdfloat _v;
|
||||
|
||||
PT(NurbsCurveEvaluator) _nurbs_curve_evaluator;
|
||||
};
|
||||
|
|
@ -40,8 +40,8 @@ public:
|
|||
class CMotionTrailFrame {
|
||||
|
||||
public:
|
||||
float _time;
|
||||
LMatrix4f _transform;
|
||||
PN_stdfloat _time;
|
||||
LMatrix4 _transform;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -98,48 +98,48 @@ PUBLISHED:
|
|||
void enable (bool enable);
|
||||
|
||||
void set_geom_node (PT(GeomNode) geom_node);
|
||||
void add_vertex (LVector4f *vertex, LVector4f *start_color, LVector4f *end_color, float v);
|
||||
void add_vertex (LVector4 *vertex, LVector4 *start_color, LVector4 *end_color, PN_stdfloat v);
|
||||
|
||||
void set_parameters (float sampling_time, float time_window, bool use_texture, bool calculate_relative_matrix, bool use_nurbs, float resolution_distance);
|
||||
void set_parameters (PN_stdfloat sampling_time, PN_stdfloat time_window, bool use_texture, bool calculate_relative_matrix, bool use_nurbs, PN_stdfloat resolution_distance);
|
||||
|
||||
int check_for_update (float current_time);
|
||||
void update_motion_trail (float current_time, LMatrix4f *transform);
|
||||
int check_for_update (PN_stdfloat current_time);
|
||||
void update_motion_trail (PN_stdfloat current_time, LMatrix4 *transform);
|
||||
|
||||
public:
|
||||
|
||||
void begin_geometry ( );
|
||||
void add_geometry_quad (LVector3f &v0, LVector3f &v1, LVector3f &v2, LVector3f &v3, LVector4f &c0, LVector4f &c1, LVector4f &c2, LVector4f &c3, LVector2f &t0, LVector2f &t1, LVector2f &t2, LVector2f &t3);
|
||||
void add_geometry_quad (LVector4f &v0, LVector4f &v1, LVector4f &v2, LVector4f &v3, LVector4f &c0, LVector4f &c1, LVector4f &c2, LVector4f &c3, LVector2f &t0, LVector2f &t1, LVector2f &t2, LVector2f &t3);
|
||||
void add_geometry_quad (LVector3 &v0, LVector3 &v1, LVector3 &v2, LVector3 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3);
|
||||
void add_geometry_quad (LVector4 &v0, LVector4 &v1, LVector4 &v2, LVector4 &v3, LVector4 &c0, LVector4 &c1, LVector4 &c2, LVector4 &c3, LVector2 &t0, LVector2 &t1, LVector2 &t2, LVector2 &t3);
|
||||
void end_geometry ( );
|
||||
|
||||
int _active;
|
||||
int _enable;
|
||||
|
||||
int _pause;
|
||||
float _pause_time;
|
||||
PN_stdfloat _pause_time;
|
||||
|
||||
int _fade;
|
||||
int _fade_end;
|
||||
float _fade_time;
|
||||
float _fade_start_time;
|
||||
float _fade_color_scale;
|
||||
PN_stdfloat _fade_time;
|
||||
PN_stdfloat _fade_start_time;
|
||||
PN_stdfloat _fade_color_scale;
|
||||
|
||||
float _last_update_time;
|
||||
PN_stdfloat _last_update_time;
|
||||
|
||||
list <CMotionTrailVertex> _vertex_list;
|
||||
list <CMotionTrailFrame> _frame_list;
|
||||
|
||||
// parameters
|
||||
float _color_scale;
|
||||
float _sampling_time;
|
||||
float _time_window;
|
||||
PN_stdfloat _color_scale;
|
||||
PN_stdfloat _sampling_time;
|
||||
PN_stdfloat _time_window;
|
||||
bool _square_t;
|
||||
bool _use_texture;
|
||||
int _calculate_relative_matrix;
|
||||
|
||||
// nurbs parameters
|
||||
bool _use_nurbs;
|
||||
float _resolution_distance;
|
||||
PN_stdfloat _resolution_distance;
|
||||
|
||||
// geom
|
||||
PT(GeomNode) _geom_node;
|
||||
|
|
|
|||
|
|
@ -994,6 +994,14 @@
|
|||
// compiled-in font).
|
||||
#define COMPILE_IN_DEFAULT_FONT 1
|
||||
|
||||
// Define this true to compile a special version of Panda to use a
|
||||
// "double" floating-precision type for most internal values, such as
|
||||
// positions and transforms, instead of the standard single-precision
|
||||
// "float" type. This does not affect the default numeric type of
|
||||
// vertices, which is controlled by the runtime config variable
|
||||
// vertices-float64. Presently *experimental*, do not use.
|
||||
#define STDFLOAT_DOUBLE
|
||||
|
||||
// We use wxWidgets--the C++ library, not the Python library--for
|
||||
// building the application p3dcert, which is needed only when
|
||||
// building the plugin/runtime system. This uses a wx-config program,
|
||||
|
|
|
|||
|
|
@ -286,6 +286,9 @@ $[cdefine HAVE_SPEEDTREE]
|
|||
/* Define if we want to compile in a default font. */
|
||||
$[cdefine COMPILE_IN_DEFAULT_FONT]
|
||||
|
||||
/* Define to use doubles for graphic values, intead of single-precision floats. */
|
||||
$[cdefine STDFLOAT_DOUBLE]
|
||||
|
||||
/* Define if we have Maya available. */
|
||||
$[cdefine HAVE_MAYA]
|
||||
$[cdefine MAYA_PRE_5_0]
|
||||
|
|
|
|||
|
|
@ -49,5 +49,13 @@ typedef unsigned long long int PN_uint64;
|
|||
typedef double PN_float64;
|
||||
typedef float PN_float32;
|
||||
|
||||
#ifndef STDFLOAT_DOUBLE
|
||||
// The default setting--single-precision floats.
|
||||
typedef float PN_stdfloat;
|
||||
#else // STDFLOAT_DOUBLE
|
||||
// The specialty setting--double-precision floats.
|
||||
typedef double PN_stdfloat;
|
||||
#endif // STDFLOAT_DOUBLE
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2033,7 +2033,6 @@ CopyAllHeaders('panda/src/lerp')
|
|||
CopyAllHeaders('panda/src/pgraphnodes')
|
||||
CopyAllHeaders('panda/src/pgraph')
|
||||
CopyAllHeaders('panda/src/cull')
|
||||
CopyAllHeaders('panda/src/effects')
|
||||
CopyAllHeaders('panda/src/chan')
|
||||
CopyAllHeaders('panda/src/char')
|
||||
CopyAllHeaders('panda/src/dgraph')
|
||||
|
|
@ -3062,18 +3061,6 @@ if (not RUNTIME):
|
|||
TargetAdd('libdistort.in', opts=['IMOD:pandafx', 'ILIB:libdistort', 'SRCDIR:panda/src/distort'])
|
||||
TargetAdd('libdistort_igate.obj', input='libdistort.in', opts=["DEPENDENCYONLY"])
|
||||
|
||||
#
|
||||
# DIRECTORY: panda/src/effects/
|
||||
#
|
||||
|
||||
if (not RUNTIME):
|
||||
OPTS=['DIR:panda/src/effects', 'BUILDING:PANDAFX', 'NVIDIACG']
|
||||
TargetAdd('effects_composite.obj', opts=OPTS, input='effects_composite.cxx')
|
||||
IGATEFILES=GetDirectoryContents('panda/src/effects', ["*.h", "*_composite.cxx"])
|
||||
TargetAdd('libeffects.in', opts=OPTS, input=IGATEFILES)
|
||||
TargetAdd('libeffects.in', opts=['IMOD:pandafx', 'ILIB:libeffects', 'SRCDIR:panda/src/effects'])
|
||||
TargetAdd('libeffects_igate.obj', input='libeffects.in', opts=["DEPENDENCYONLY"])
|
||||
|
||||
#
|
||||
# DIRECTORY: panda/metalibs/pandafx/
|
||||
#
|
||||
|
|
@ -3083,7 +3070,6 @@ if (not RUNTIME):
|
|||
TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
|
||||
|
||||
TargetAdd('libpandafx_module.obj', input='libdistort.in')
|
||||
TargetAdd('libpandafx_module.obj', input='libeffects.in')
|
||||
TargetAdd('libpandafx_module.obj', opts=OPTS)
|
||||
TargetAdd('libpandafx_module.obj', opts=['IMOD:pandafx', 'ILIB:libpandafx'])
|
||||
|
||||
|
|
@ -3091,8 +3077,6 @@ if (not RUNTIME):
|
|||
TargetAdd('libpandafx.dll', input='libpandafx_module.obj')
|
||||
TargetAdd('libpandafx.dll', input='distort_composite.obj')
|
||||
TargetAdd('libpandafx.dll', input='libdistort_igate.obj')
|
||||
TargetAdd('libpandafx.dll', input='effects_composite.obj')
|
||||
TargetAdd('libpandafx.dll', input='libeffects_igate.obj')
|
||||
TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
|
||||
TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ update() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioManager::audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) {
|
||||
void AudioManager::audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz, PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz, PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ void AudioManager::audio_3d_set_listener_attributes(float px, float py, float pz
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioManager::audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) {
|
||||
void AudioManager::audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz, PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz, PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ void AudioManager::audio_3d_get_listener_attributes(float *px, float *py, float
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioManager::audio_3d_set_distance_factor(float factor) {
|
||||
void AudioManager::audio_3d_set_distance_factor(PN_stdfloat factor) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ void AudioManager::audio_3d_set_distance_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float AudioManager::audio_3d_get_distance_factor() const {
|
||||
PN_stdfloat AudioManager::audio_3d_get_distance_factor() const {
|
||||
// intentionally blank.
|
||||
return 0.0f;
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ float AudioManager::audio_3d_get_distance_factor() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioManager::audio_3d_set_doppler_factor(float factor) {
|
||||
void AudioManager::audio_3d_set_doppler_factor(PN_stdfloat factor) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ void AudioManager::audio_3d_set_doppler_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float AudioManager::audio_3d_get_doppler_factor() const {
|
||||
PN_stdfloat AudioManager::audio_3d_get_doppler_factor() const {
|
||||
// intentionally blank.
|
||||
return 0.0f;
|
||||
}
|
||||
|
|
@ -273,7 +273,7 @@ float AudioManager::audio_3d_get_doppler_factor() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioManager::audio_3d_set_drop_off_factor(float factor) {
|
||||
void AudioManager::audio_3d_set_drop_off_factor(PN_stdfloat factor) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -282,7 +282,7 @@ void AudioManager::audio_3d_set_drop_off_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float AudioManager::audio_3d_get_drop_off_factor() const {
|
||||
PN_stdfloat AudioManager::audio_3d_get_drop_off_factor() const {
|
||||
// intentionally blank.
|
||||
return 0.0f;
|
||||
}
|
||||
|
|
@ -356,6 +356,6 @@ write(ostream &out) const {
|
|||
// Description: For use only with Miles.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioManager::
|
||||
set_speaker_configuration(LVecBase3f *speaker1, LVecBase3f *speaker2, LVecBase3f *speaker3, LVecBase3f *speaker4, LVecBase3f *speaker5, LVecBase3f *speaker6, LVecBase3f *speaker7, LVecBase3f *speaker8, LVecBase3f *speaker9) {
|
||||
set_speaker_configuration(LVecBase3 *speaker1, LVecBase3 *speaker2, LVecBase3 *speaker3, LVecBase3 *speaker4, LVecBase3 *speaker5, LVecBase3 *speaker6, LVecBase3 *speaker7, LVecBase3 *speaker8, LVecBase3 *speaker9) {
|
||||
// intentionally blank
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,8 +111,8 @@ PUBLISHED:
|
|||
// up later, you'll hear the sound playing at that late point.
|
||||
// 0 = minimum; 1.0 = maximum.
|
||||
// inits to 1.0.
|
||||
virtual void set_volume(float volume) = 0;
|
||||
virtual float get_volume() const = 0;
|
||||
virtual void set_volume(PN_stdfloat volume) = 0;
|
||||
virtual PN_stdfloat get_volume() const = 0;
|
||||
|
||||
// Turn the manager on or off.
|
||||
// If you play a sound while the manager is inactive, it won't start.
|
||||
|
|
@ -157,34 +157,34 @@ PUBLISHED:
|
|||
// vx, vy, vz are a velocity vector in UNITS PER SECOND (default: meters).
|
||||
// fx, fy and fz are the respective components of a unit forward-vector
|
||||
// ux, uy and uz are the respective components of a unit up-vector
|
||||
virtual void audio_3d_set_listener_attributes(float px, float py, float pz,
|
||||
float vx, float vy, float vz,
|
||||
float fx, float fy, float fz,
|
||||
float ux, float uy, float uz);
|
||||
virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz,
|
||||
float *vx, float *vy, float *vz,
|
||||
float *fx, float *fy, float *fz,
|
||||
float *ux, float *uy, float *uz);
|
||||
virtual void audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
|
||||
PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz,
|
||||
PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz,
|
||||
PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz);
|
||||
virtual void audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz,
|
||||
PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz,
|
||||
PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz,
|
||||
PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz);
|
||||
|
||||
// Control the "relative scale that sets the distance factor" units for 3D spacialized audio. Default is 1.0
|
||||
// Fmod uses meters internally, so give a float in Units-per meter
|
||||
// Don't know what Miles uses.
|
||||
// Default is 1.0 which is adjust in panda to be feet.
|
||||
virtual void audio_3d_set_distance_factor(float factor);
|
||||
virtual float audio_3d_get_distance_factor() const;
|
||||
virtual void audio_3d_set_distance_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_distance_factor() const;
|
||||
|
||||
// Control the presence of the Doppler effect. Default is 1.0
|
||||
// Exaggerated Doppler, use >1.0
|
||||
// Diminshed Doppler, use <1.0
|
||||
virtual void audio_3d_set_doppler_factor(float factor);
|
||||
virtual float audio_3d_get_doppler_factor() const;
|
||||
virtual void audio_3d_set_doppler_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_doppler_factor() const;
|
||||
|
||||
// Exaggerate or diminish the effect of distance on sound. Default is 1.0
|
||||
// Valid range is 0 to 10
|
||||
// Faster drop off, use >1.0
|
||||
// Slower drop off, use <1.0
|
||||
virtual void audio_3d_set_drop_off_factor(float factor);
|
||||
virtual float audio_3d_get_drop_off_factor() const;
|
||||
virtual void audio_3d_set_drop_off_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_drop_off_factor() const;
|
||||
|
||||
static Filename get_dls_pathname();
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ PUBLISHED:
|
|||
virtual void write(ostream &out) const;
|
||||
|
||||
// set_speaker_configuration is a Miles only method.
|
||||
virtual void set_speaker_configuration(LVecBase3f *speaker1, LVecBase3f *speaker2=NULL, LVecBase3f *speaker3=NULL, LVecBase3f *speaker4=NULL, LVecBase3f *speaker5=NULL, LVecBase3f *speaker6=NULL, LVecBase3f *speaker7=NULL, LVecBase3f *speaker8=NULL, LVecBase3f *speaker9=NULL);
|
||||
virtual void set_speaker_configuration(LVecBase3 *speaker1, LVecBase3 *speaker2=NULL, LVecBase3 *speaker3=NULL, LVecBase3 *speaker4=NULL, LVecBase3 *speaker5=NULL, LVecBase3 *speaker6=NULL, LVecBase3 *speaker7=NULL, LVecBase3 *speaker8=NULL, LVecBase3 *speaker9=NULL);
|
||||
|
||||
public:
|
||||
static void register_AudioManager_creator(Create_AudioManager_proc* proc);
|
||||
|
|
|
|||
|
|
@ -38,32 +38,32 @@ AudioSound() {
|
|||
|
||||
|
||||
void AudioSound::
|
||||
set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) {
|
||||
set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
void AudioSound::
|
||||
get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz) {
|
||||
get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
void AudioSound::
|
||||
set_3d_min_distance(float dist) {
|
||||
set_3d_min_distance(PN_stdfloat dist) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float AudioSound::
|
||||
PN_stdfloat AudioSound::
|
||||
get_3d_min_distance() const {
|
||||
// Intentionally blank.
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void AudioSound::
|
||||
set_3d_max_distance(float dist) {
|
||||
set_3d_max_distance(PN_stdfloat dist) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float AudioSound::
|
||||
PN_stdfloat AudioSound::
|
||||
get_3d_max_distance() const {
|
||||
// Intentionally blank.
|
||||
return 0.0f;
|
||||
|
|
@ -74,7 +74,7 @@ get_3d_max_distance() const {
|
|||
// Access: Published
|
||||
// Description: For use only with FMOD.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float AudioSound::
|
||||
PN_stdfloat AudioSound::
|
||||
get_speaker_mix(int speaker) {
|
||||
// intentionally blank
|
||||
return 0.0;
|
||||
|
|
@ -86,7 +86,7 @@ get_speaker_mix(int speaker) {
|
|||
// Description: For use only with FMOD.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioSound::
|
||||
set_speaker_mix(float frontleft, float frontright, float center, float sub, float backleft, float backright, float sideleft, float sideright) {
|
||||
set_speaker_mix(PN_stdfloat frontleft, PN_stdfloat frontright, PN_stdfloat center, PN_stdfloat sub, PN_stdfloat backleft, PN_stdfloat backright, PN_stdfloat sideleft, PN_stdfloat sideright) {
|
||||
// intentionally blank
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ set_speaker_mix(float frontleft, float frontright, float center, float sub, floa
|
|||
// Access: Published
|
||||
// Description: For use only with Miles.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float AudioSound::
|
||||
PN_stdfloat AudioSound::
|
||||
get_speaker_level(int index) {
|
||||
// intentionally blank
|
||||
return 0.0;
|
||||
|
|
@ -107,7 +107,7 @@ get_speaker_level(int index) {
|
|||
// Description: For use only with Miles.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioSound::
|
||||
set_speaker_levels(float level1, float level2, float level3, float level4, float level5, float level6, float level7, float level8, float level9) {
|
||||
set_speaker_levels(PN_stdfloat level1, PN_stdfloat level2, PN_stdfloat level3, PN_stdfloat level4, PN_stdfloat level5, PN_stdfloat level6, PN_stdfloat level7, PN_stdfloat level8, PN_stdfloat level9) {
|
||||
// intentionally blank
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,26 +60,26 @@ PUBLISHED:
|
|||
// sound.
|
||||
// - If a sound is playing, calling get_time() repeatedly will
|
||||
// return different results over time. e.g.:
|
||||
// float percent_complete = s.get_time() / s.length();
|
||||
virtual void set_time(float start_time=0.0) = 0;
|
||||
virtual float get_time() const = 0;
|
||||
// PN_stdfloat percent_complete = s.get_time() / s.length();
|
||||
virtual void set_time(PN_stdfloat start_time=0.0) = 0;
|
||||
virtual PN_stdfloat get_time() const = 0;
|
||||
|
||||
// 0 = minimum; 1.0 = maximum.
|
||||
// inits to 1.0.
|
||||
virtual void set_volume(float volume=1.0) = 0;
|
||||
virtual float get_volume() const = 0;
|
||||
virtual void set_volume(PN_stdfloat volume=1.0) = 0;
|
||||
virtual PN_stdfloat get_volume() const = 0;
|
||||
|
||||
// -1.0 is hard left
|
||||
// 0.0 is centered
|
||||
// 1.0 is hard right
|
||||
// inits to 0.0.
|
||||
virtual void set_balance(float balance_right=0.0) = 0;
|
||||
virtual float get_balance() const = 0;
|
||||
virtual void set_balance(PN_stdfloat balance_right=0.0) = 0;
|
||||
virtual PN_stdfloat get_balance() const = 0;
|
||||
|
||||
// play_rate is any positive float value.
|
||||
// play_rate is any positive PN_stdfloat value.
|
||||
// inits to 1.0.
|
||||
virtual void set_play_rate(float play_rate=1.0f) = 0;
|
||||
virtual float get_play_rate() const = 0;
|
||||
virtual void set_play_rate(PN_stdfloat play_rate=1.0f) = 0;
|
||||
virtual PN_stdfloat get_play_rate() const = 0;
|
||||
|
||||
// inits to manager's state.
|
||||
virtual void set_active(bool flag=true) = 0;
|
||||
|
|
@ -94,15 +94,15 @@ PUBLISHED:
|
|||
virtual const string& get_name() const = 0;
|
||||
|
||||
// return: playing time in seconds.
|
||||
virtual float length() const = 0;
|
||||
virtual PN_stdfloat length() const = 0;
|
||||
|
||||
// Controls the position of this sound's emitter.
|
||||
// px, py and pz are the emitter's position.
|
||||
// vx, vy and vz are the emitter's velocity in UNITS PER SECOND (default: meters).
|
||||
virtual void set_3d_attributes(float px, float py, float pz,
|
||||
float vx, float vy, float vz);
|
||||
virtual void get_3d_attributes(float *px, float *py, float *pz,
|
||||
float *vx, float *vy, float *vz);
|
||||
virtual void set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
|
||||
PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz);
|
||||
virtual void get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz,
|
||||
PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz);
|
||||
|
||||
|
||||
// Controls the distance (in units) that this sound begins to fall off.
|
||||
|
|
@ -110,15 +110,15 @@ PUBLISHED:
|
|||
// Default is 1.0
|
||||
// Closer/Faster, <1.0
|
||||
// Farther/Slower, >1.0
|
||||
virtual void set_3d_min_distance(float dist);
|
||||
virtual float get_3d_min_distance() const;
|
||||
virtual void set_3d_min_distance(PN_stdfloat dist);
|
||||
virtual PN_stdfloat get_3d_min_distance() const;
|
||||
|
||||
// Controls the maximum distance (in units) that this sound stops falling off.
|
||||
// The sound does not stop at that point, it just doesn't get any quieter.
|
||||
// You should rarely need to adjust this.
|
||||
// Default is 1000000000.0
|
||||
virtual void set_3d_max_distance(float dist);
|
||||
virtual float get_3d_max_distance() const;
|
||||
virtual void set_3d_max_distance(PN_stdfloat dist);
|
||||
virtual PN_stdfloat get_3d_max_distance() const;
|
||||
|
||||
// *_speaker_mix and *_speaker_level(s) serve the same purpose.
|
||||
// *_speaker_mix is for use with FMOD.
|
||||
|
|
@ -126,11 +126,11 @@ PUBLISHED:
|
|||
// Both interfaces exist because of a significant difference in the
|
||||
// two APIs. Hopefully the difference can be reconciled into a single
|
||||
// interface at some point.
|
||||
virtual float get_speaker_mix(int speaker);
|
||||
virtual void set_speaker_mix(float frontleft, float frontright, float center, float sub, float backleft, float backright, float sideleft, float sideright);
|
||||
virtual PN_stdfloat get_speaker_mix(int speaker);
|
||||
virtual void set_speaker_mix(PN_stdfloat frontleft, PN_stdfloat frontright, PN_stdfloat center, PN_stdfloat sub, PN_stdfloat backleft, PN_stdfloat backright, PN_stdfloat sideleft, PN_stdfloat sideright);
|
||||
|
||||
virtual float get_speaker_level(int index);
|
||||
virtual void set_speaker_levels(float level1, float level2=-1.0f, float level3=-1.0f, float level4=-1.0f, float level5=-1.0f, float level6=-1.0f, float level7=-1.0f, float level8=-1.0f, float level9=-1.0f);
|
||||
virtual PN_stdfloat get_speaker_level(int index);
|
||||
virtual void set_speaker_levels(PN_stdfloat level1, PN_stdfloat level2=-1.0f, PN_stdfloat level3=-1.0f, PN_stdfloat level4=-1.0f, PN_stdfloat level5=-1.0f, PN_stdfloat level6=-1.0f, PN_stdfloat level7=-1.0f, PN_stdfloat level8=-1.0f, PN_stdfloat level9=-1.0f);
|
||||
|
||||
virtual int get_priority();
|
||||
virtual void set_priority(int priority);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ clear() {
|
|||
// Description: Add a lowpass filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_lowpass(float cutoff_freq, float resonance_q) {
|
||||
add_lowpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
|
||||
add_filter(FT_lowpass, cutoff_freq, resonance_q);
|
||||
}
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ add_lowpass(float cutoff_freq, float resonance_q) {
|
|||
// Description: Add a highpass filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_highpass(float cutoff_freq, float resonance_q) {
|
||||
add_highpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
|
||||
add_filter(FT_highpass, cutoff_freq, resonance_q);
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ add_highpass(float cutoff_freq, float resonance_q) {
|
|||
// Description: Add a echo filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_echo(float drymix, float wetmix, float delay, float decayratio) {
|
||||
add_echo(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat delay, PN_stdfloat decayratio) {
|
||||
add_filter(FT_echo, drymix, wetmix, delay, decayratio);
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ add_echo(float drymix, float wetmix, float delay, float decayratio) {
|
|||
// Description: Add a flange filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_flange(float drymix, float wetmix, float depth, float rate) {
|
||||
add_flange(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat depth, PN_stdfloat rate) {
|
||||
add_filter(FT_flange, drymix, wetmix, depth, rate);
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ add_flange(float drymix, float wetmix, float depth, float rate) {
|
|||
// Description: Add a distort filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_distort(float level) {
|
||||
add_distort(PN_stdfloat level) {
|
||||
add_filter(FT_distort, level);
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ add_distort(float level) {
|
|||
// Description: Add a normalize filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_normalize(float fadetime, float threshold, float maxamp) {
|
||||
add_normalize(PN_stdfloat fadetime, PN_stdfloat threshold, PN_stdfloat maxamp) {
|
||||
add_filter(FT_normalize, fadetime, threshold, maxamp);
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ add_normalize(float fadetime, float threshold, float maxamp) {
|
|||
// Description: Add a parameq filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_parameq(float center_freq, float bandwidth, float gain) {
|
||||
add_parameq(PN_stdfloat center_freq, PN_stdfloat bandwidth, PN_stdfloat gain) {
|
||||
add_filter(FT_parameq, center_freq, bandwidth, gain);
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ add_parameq(float center_freq, float bandwidth, float gain) {
|
|||
// Description: Add a pitchshift filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_pitchshift(float pitch, float fftsize, float overlap) {
|
||||
add_pitchshift(PN_stdfloat pitch, PN_stdfloat fftsize, PN_stdfloat overlap) {
|
||||
add_filter(FT_pitchshift, pitch, fftsize, overlap);
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ add_pitchshift(float pitch, float fftsize, float overlap) {
|
|||
// Description: Add a chorus filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_chorus(float drymix, float wet1, float wet2, float wet3, float delay, float rate, float depth, float feedback) {
|
||||
add_chorus(PN_stdfloat drymix, PN_stdfloat wet1, PN_stdfloat wet2, PN_stdfloat wet3, PN_stdfloat delay, PN_stdfloat rate, PN_stdfloat depth, PN_stdfloat feedback) {
|
||||
add_filter(FT_chorus, drymix, wet1, wet2, wet3, delay, rate, depth, feedback);
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ add_chorus(float drymix, float wet1, float wet2, float wet3, float delay, float
|
|||
// Description: Add a reverb filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_reverb(float drymix, float wetmix, float roomsize, float damp, float width) {
|
||||
add_reverb(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat roomsize, PN_stdfloat damp, PN_stdfloat width) {
|
||||
add_filter(FT_reverb, drymix, wetmix, roomsize, damp, width);
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ add_reverb(float drymix, float wetmix, float roomsize, float damp, float width)
|
|||
// Description: Add a compress filter to the end of the DSP chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FilterProperties::
|
||||
add_compress(float threshold, float attack, float release, float gainmakeup) {
|
||||
add_compress(PN_stdfloat threshold, PN_stdfloat attack, PN_stdfloat release, PN_stdfloat gainmakeup) {
|
||||
add_filter(FT_compress, threshold, attack, release, gainmakeup);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ FilterProperties::
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FilterProperties::
|
||||
add_filter(FilterType t, float a, float b, float c, float d, float e, float f, float g, float h) {
|
||||
add_filter(FilterType t, PN_stdfloat a, PN_stdfloat b, PN_stdfloat c, PN_stdfloat d, PN_stdfloat e, PN_stdfloat f, PN_stdfloat g, PN_stdfloat h) {
|
||||
FilterConfig conf;
|
||||
conf._type = t;
|
||||
conf._a = a;
|
||||
|
|
|
|||
|
|
@ -28,17 +28,17 @@ class EXPCL_PANDA_AUDIO FilterProperties : public TypedReferenceCount {
|
|||
FilterProperties();
|
||||
~FilterProperties();
|
||||
INLINE void clear();
|
||||
INLINE void add_lowpass(float cutoff_freq, float resonance_q);
|
||||
INLINE void add_highpass(float cutoff_freq, float resonance_q);
|
||||
INLINE void add_echo(float drymix, float wetmix, float delay, float decayratio);
|
||||
INLINE void add_flange(float drymix, float wetmix, float depth, float rate);
|
||||
INLINE void add_distort(float level);
|
||||
INLINE void add_normalize(float fadetime, float threshold, float maxamp);
|
||||
INLINE void add_parameq(float center_freq, float bandwidth, float gain);
|
||||
INLINE void add_pitchshift(float pitch, float fftsize, float overlap);
|
||||
INLINE void add_chorus(float drymix, float wet1, float wet2, float wet3, float delay, float rate, float depth, float feedback);
|
||||
INLINE void add_reverb(float drymix, float wetmix, float roomsize, float damp, float width);
|
||||
INLINE void add_compress(float threshold, float attack, float release, float gainmakeup);
|
||||
INLINE void add_lowpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q);
|
||||
INLINE void add_highpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q);
|
||||
INLINE void add_echo(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat delay, PN_stdfloat decayratio);
|
||||
INLINE void add_flange(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat depth, PN_stdfloat rate);
|
||||
INLINE void add_distort(PN_stdfloat level);
|
||||
INLINE void add_normalize(PN_stdfloat fadetime, PN_stdfloat threshold, PN_stdfloat maxamp);
|
||||
INLINE void add_parameq(PN_stdfloat center_freq, PN_stdfloat bandwidth, PN_stdfloat gain);
|
||||
INLINE void add_pitchshift(PN_stdfloat pitch, PN_stdfloat fftsize, PN_stdfloat overlap);
|
||||
INLINE void add_chorus(PN_stdfloat drymix, PN_stdfloat wet1, PN_stdfloat wet2, PN_stdfloat wet3, PN_stdfloat delay, PN_stdfloat rate, PN_stdfloat depth, PN_stdfloat feedback);
|
||||
INLINE void add_reverb(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat roomsize, PN_stdfloat damp, PN_stdfloat width);
|
||||
INLINE void add_compress(PN_stdfloat threshold, PN_stdfloat attack, PN_stdfloat release, PN_stdfloat gainmakeup);
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -58,14 +58,14 @@ class EXPCL_PANDA_AUDIO FilterProperties : public TypedReferenceCount {
|
|||
|
||||
struct FilterConfig {
|
||||
FilterType _type;
|
||||
float _a,_b,_c,_d;
|
||||
float _e,_f,_g,_h;
|
||||
PN_stdfloat _a,_b,_c,_d;
|
||||
PN_stdfloat _e,_f,_g,_h;
|
||||
};
|
||||
|
||||
typedef pvector<FilterConfig> ConfigVector;
|
||||
|
||||
private:
|
||||
void add_filter(FilterType t, float a=0, float b=0, float c=0, float d=0, float e=0, float f=0, float g=0, float h=0);
|
||||
void add_filter(FilterType t, PN_stdfloat a=0, PN_stdfloat b=0, PN_stdfloat c=0, PN_stdfloat d=0, PN_stdfloat e=0, PN_stdfloat f=0, PN_stdfloat g=0, PN_stdfloat h=0);
|
||||
ConfigVector _config;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ TypeHandle NullAudioManager::_type_handle;
|
|||
|
||||
//namespace {
|
||||
//static const string blank="";
|
||||
//static float no_listener_attributes [] = {0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f};
|
||||
//static PN_stdfloat no_listener_attributes [] = {0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f};
|
||||
//}
|
||||
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ get_cache_limit() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void NullAudioManager::
|
||||
set_volume(float) {
|
||||
set_volume(PN_stdfloat) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ set_volume(float) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float NullAudioManager::
|
||||
PN_stdfloat NullAudioManager::
|
||||
get_volume() const {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -140,7 +140,7 @@ get_volume() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void NullAudioManager::
|
||||
set_play_rate(float) {
|
||||
set_play_rate(PN_stdfloat) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ set_play_rate(float) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float NullAudioManager::
|
||||
PN_stdfloat NullAudioManager::
|
||||
get_play_rate() const {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -220,7 +220,7 @@ stop_all_sounds() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void NullAudioManager::
|
||||
audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) {
|
||||
audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz, PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz, PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float v
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void NullAudioManager::
|
||||
audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) {
|
||||
audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz, PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz, PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, flo
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void NullAudioManager::
|
||||
audio_3d_set_distance_factor(float factor) {
|
||||
audio_3d_set_distance_factor(PN_stdfloat factor) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -249,7 +249,7 @@ audio_3d_set_distance_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float NullAudioManager::
|
||||
PN_stdfloat NullAudioManager::
|
||||
audio_3d_get_distance_factor() const {
|
||||
// intentionally blank.
|
||||
return 0.0f;
|
||||
|
|
@ -261,7 +261,7 @@ audio_3d_get_distance_factor() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void NullAudioManager::
|
||||
audio_3d_set_doppler_factor(float factor) {
|
||||
audio_3d_set_doppler_factor(PN_stdfloat factor) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ audio_3d_set_doppler_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float NullAudioManager::
|
||||
PN_stdfloat NullAudioManager::
|
||||
audio_3d_get_doppler_factor() const {
|
||||
// intentionally blank.
|
||||
return 0.0f;
|
||||
|
|
@ -282,7 +282,7 @@ audio_3d_get_doppler_factor() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void NullAudioManager::
|
||||
audio_3d_set_drop_off_factor(float factor) {
|
||||
audio_3d_set_drop_off_factor(PN_stdfloat factor) {
|
||||
// intentionally blank.
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ audio_3d_set_drop_off_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float NullAudioManager::
|
||||
PN_stdfloat NullAudioManager::
|
||||
audio_3d_get_drop_off_factor() const {
|
||||
// intentionally blank.
|
||||
return 0.0f;
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ public:
|
|||
virtual void set_cache_limit(unsigned int);
|
||||
virtual unsigned int get_cache_limit() const;
|
||||
|
||||
virtual void set_volume(float);
|
||||
virtual float get_volume() const;
|
||||
virtual void set_volume(PN_stdfloat);
|
||||
virtual PN_stdfloat get_volume() const;
|
||||
|
||||
virtual void set_play_rate(float);
|
||||
virtual float get_play_rate() const;
|
||||
virtual void set_play_rate(PN_stdfloat);
|
||||
virtual PN_stdfloat get_play_rate() const;
|
||||
|
||||
virtual void set_active(bool);
|
||||
virtual bool get_active() const;
|
||||
|
|
@ -53,23 +53,23 @@ public:
|
|||
|
||||
virtual void stop_all_sounds();
|
||||
|
||||
virtual void audio_3d_set_listener_attributes(float px, float py, float pz,
|
||||
float vx, float vy, float vz,
|
||||
float fx, float fy, float fz,
|
||||
float ux, float uy, float uz);
|
||||
virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz,
|
||||
float *vx, float *vy, float *vz,
|
||||
float *fx, float *fy, float *fz,
|
||||
float *ux, float *uy, float *uz);
|
||||
virtual void audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
|
||||
PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz,
|
||||
PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz,
|
||||
PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz);
|
||||
virtual void audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz,
|
||||
PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz,
|
||||
PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz,
|
||||
PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz);
|
||||
|
||||
virtual void audio_3d_set_distance_factor(float factor);
|
||||
virtual float audio_3d_get_distance_factor() const;
|
||||
virtual void audio_3d_set_distance_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_distance_factor() const;
|
||||
|
||||
virtual void audio_3d_set_doppler_factor(float factor);
|
||||
virtual float audio_3d_get_doppler_factor() const;
|
||||
virtual void audio_3d_set_doppler_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_doppler_factor() const;
|
||||
|
||||
virtual void audio_3d_set_drop_off_factor(float factor);
|
||||
virtual float audio_3d_get_drop_off_factor() const;
|
||||
virtual void audio_3d_set_drop_off_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_drop_off_factor() const;
|
||||
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ TypeHandle NullAudioSound::_type_handle;
|
|||
|
||||
namespace {
|
||||
static const string blank="";
|
||||
// static float no_attributes [] = {0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f};
|
||||
// static PN_stdfloat no_attributes [] = {0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -59,35 +59,35 @@ unsigned long NullAudioSound::get_loop_count() const {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void NullAudioSound::set_time(float) {
|
||||
void NullAudioSound::set_time(PN_stdfloat) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float NullAudioSound::get_time() const {
|
||||
PN_stdfloat NullAudioSound::get_time() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NullAudioSound::set_volume(float) {
|
||||
void NullAudioSound::set_volume(PN_stdfloat) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float NullAudioSound::get_volume() const {
|
||||
PN_stdfloat NullAudioSound::get_volume() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NullAudioSound::set_balance(float) {
|
||||
void NullAudioSound::set_balance(PN_stdfloat) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float NullAudioSound::get_balance() const {
|
||||
PN_stdfloat NullAudioSound::get_balance() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NullAudioSound::set_play_rate(float) {
|
||||
void NullAudioSound::set_play_rate(PN_stdfloat) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float NullAudioSound::get_play_rate() const {
|
||||
PN_stdfloat NullAudioSound::get_play_rate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -111,32 +111,32 @@ const string& NullAudioSound::get_name() const {
|
|||
return blank;
|
||||
}
|
||||
|
||||
float NullAudioSound::length() const {
|
||||
PN_stdfloat NullAudioSound::length() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NullAudioSound::set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) {
|
||||
void NullAudioSound::set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
void NullAudioSound::get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz) {
|
||||
void NullAudioSound::get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
void NullAudioSound::set_3d_min_distance(float dist) {
|
||||
void NullAudioSound::set_3d_min_distance(PN_stdfloat dist) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float NullAudioSound::get_3d_min_distance() const {
|
||||
PN_stdfloat NullAudioSound::get_3d_min_distance() const {
|
||||
// Intentionally blank.
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void NullAudioSound::set_3d_max_distance(float dist) {
|
||||
void NullAudioSound::set_3d_max_distance(PN_stdfloat dist) {
|
||||
// Intentionally blank.
|
||||
}
|
||||
|
||||
float NullAudioSound::get_3d_max_distance() const {
|
||||
PN_stdfloat NullAudioSound::get_3d_max_distance() const {
|
||||
// Intentionally blank.
|
||||
return 0.0f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,17 +39,17 @@ public:
|
|||
void set_loop_count(unsigned long);
|
||||
unsigned long get_loop_count() const;
|
||||
|
||||
void set_time(float);
|
||||
float get_time() const;
|
||||
void set_time(PN_stdfloat);
|
||||
PN_stdfloat get_time() const;
|
||||
|
||||
void set_volume(float);
|
||||
float get_volume() const;
|
||||
void set_volume(PN_stdfloat);
|
||||
PN_stdfloat get_volume() const;
|
||||
|
||||
void set_balance(float);
|
||||
float get_balance() const;
|
||||
void set_balance(PN_stdfloat);
|
||||
PN_stdfloat get_balance() const;
|
||||
|
||||
void set_play_rate(float);
|
||||
float get_play_rate() const;
|
||||
void set_play_rate(PN_stdfloat);
|
||||
PN_stdfloat get_play_rate() const;
|
||||
|
||||
void set_active(bool);
|
||||
bool get_active() const;
|
||||
|
|
@ -59,14 +59,14 @@ public:
|
|||
|
||||
const string& get_name() const;
|
||||
|
||||
float length() const;
|
||||
PN_stdfloat length() const;
|
||||
|
||||
void set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz);
|
||||
void get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz);
|
||||
void set_3d_min_distance(float dist);
|
||||
float get_3d_min_distance() const;
|
||||
void set_3d_max_distance(float dist);
|
||||
float get_3d_max_distance() const;
|
||||
void set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz);
|
||||
void get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz);
|
||||
void set_3d_min_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_min_distance() const;
|
||||
void set_3d_max_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_max_distance() const;
|
||||
|
||||
AudioSound::SoundStatus status() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ bool FmodAudioManager::_system_is_valid = false;
|
|||
// Since Panda use feet we need to compensate for that with a factor of 3.28
|
||||
//
|
||||
// This can be overwritten. You just need to call
|
||||
// audio_3d_set_distance_factor(float factor) and set your new factor.
|
||||
// audio_3d_set_distance_factor(PN_stdfloat factor) and set your new factor.
|
||||
|
||||
float FmodAudioManager::_doppler_factor = 1;
|
||||
float FmodAudioManager::_distance_factor = 3.28;
|
||||
float FmodAudioManager::_drop_off_factor = 1;
|
||||
PN_stdfloat FmodAudioManager::_doppler_factor = 1;
|
||||
PN_stdfloat FmodAudioManager::_distance_factor = 3.28;
|
||||
PN_stdfloat FmodAudioManager::_drop_off_factor = 1;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -517,13 +517,13 @@ setSpeakerSetup(AudioManager::SpeakerModeCategory cat) {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FmodAudioManager::set_volume(float volume)
|
||||
// Function: FmodAudioManager::set_volume(PN_stdfloat volume)
|
||||
// Access: Public
|
||||
// Description: Sets the volume of the AudioManager.
|
||||
// It is not an override, but a multiplier.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioManager::
|
||||
set_volume(float volume) {
|
||||
set_volume(PN_stdfloat volume) {
|
||||
FMOD_RESULT result;
|
||||
result = _channelgroup->setVolume(volume);
|
||||
fmod_audio_errcheck("_channelgroup->setVolume()", result);
|
||||
|
|
@ -534,13 +534,13 @@ set_volume(float volume) {
|
|||
// Access: Public
|
||||
// Description: Returns the AudioManager's volume.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioManager::
|
||||
PN_stdfloat FmodAudioManager::
|
||||
get_volume() const {
|
||||
float volume;
|
||||
FMOD_RESULT result;
|
||||
result = _channelgroup->getVolume(&volume);
|
||||
fmod_audio_errcheck("_channelgroup->getVolume()", result);
|
||||
return volume;
|
||||
return (PN_stdfloat)volume;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -620,7 +620,7 @@ update() {
|
|||
// I told you, so you can't say I didn't.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioManager::
|
||||
audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) {
|
||||
audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz, PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz, PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz) {
|
||||
audio_debug("FmodAudioManager::audio_3d_set_listener_attributes()");
|
||||
|
||||
FMOD_RESULT result;
|
||||
|
|
@ -652,7 +652,7 @@ audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float v
|
|||
// Description: Get position of the "ear" that picks up 3d sounds
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioManager::
|
||||
audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) {
|
||||
audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz, PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz, PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz) {
|
||||
audio_error("audio3dGetListenerAttributes: currently unimplemented. Get the attributes of the attached object");
|
||||
|
||||
}
|
||||
|
|
@ -665,7 +665,7 @@ audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, flo
|
|||
// its sound-spacialization calculations)
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioManager::
|
||||
audio_3d_set_distance_factor(float factor) {
|
||||
audio_3d_set_distance_factor(PN_stdfloat factor) {
|
||||
audio_debug( "FmodAudioManager::audio_3d_set_distance_factor( factor= " << factor << ")" );
|
||||
|
||||
FMOD_RESULT result;
|
||||
|
|
@ -684,7 +684,7 @@ audio_3d_set_distance_factor(float factor) {
|
|||
// Description: Gets units per meter (Fmod uses meters internally for
|
||||
// its sound-spacialization calculations)
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioManager::
|
||||
PN_stdfloat FmodAudioManager::
|
||||
audio_3d_get_distance_factor() const {
|
||||
audio_debug("FmodAudioManager::audio_3d_get_distance_factor()");
|
||||
|
||||
|
|
@ -698,7 +698,7 @@ audio_3d_get_distance_factor() const {
|
|||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioManager::
|
||||
audio_3d_set_doppler_factor(float factor) {
|
||||
audio_3d_set_doppler_factor(PN_stdfloat factor) {
|
||||
audio_debug("FmodAudioManager::audio_3d_set_doppler_factor(factor="<<factor<<")");
|
||||
|
||||
FMOD_RESULT result;
|
||||
|
|
@ -715,7 +715,7 @@ audio_3d_set_doppler_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioManager::
|
||||
PN_stdfloat FmodAudioManager::
|
||||
audio_3d_get_doppler_factor() const {
|
||||
audio_debug("FmodAudioManager::audio_3d_get_doppler_factor()");
|
||||
|
||||
|
|
@ -729,7 +729,7 @@ audio_3d_get_doppler_factor() const {
|
|||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioManager::
|
||||
audio_3d_set_drop_off_factor(float factor) {
|
||||
audio_3d_set_drop_off_factor(PN_stdfloat factor) {
|
||||
audio_debug("FmodAudioManager::audio_3d_set_drop_off_factor("<<factor<<")");
|
||||
|
||||
FMOD_RESULT result;
|
||||
|
|
@ -746,7 +746,7 @@ audio_3d_set_drop_off_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioManager::
|
||||
PN_stdfloat FmodAudioManager::
|
||||
audio_3d_get_drop_off_factor() const {
|
||||
audio_debug("FmodAudioManager::audio_3d_get_drop_off_factor()");
|
||||
|
||||
|
|
|
|||
|
|
@ -105,8 +105,8 @@ class EXPCL_FMOD_AUDIO FmodAudioManager : public AudioManager {
|
|||
virtual int getSpeakerSetup();
|
||||
virtual void setSpeakerSetup(SpeakerModeCategory cat);
|
||||
|
||||
virtual void set_volume(float);
|
||||
virtual float get_volume() const;
|
||||
virtual void set_volume(PN_stdfloat);
|
||||
virtual PN_stdfloat get_volume() const;
|
||||
|
||||
virtual void set_active(bool);
|
||||
virtual bool get_active() const;
|
||||
|
|
@ -121,34 +121,34 @@ class EXPCL_FMOD_AUDIO FmodAudioManager : public AudioManager {
|
|||
// fx, fy and fz are the respective components of a unit forward-vector
|
||||
// ux, uy and uz are the respective components of a unit up-vector
|
||||
// These changes will NOT be invoked until audio_3d_update() is called.
|
||||
virtual void audio_3d_set_listener_attributes(float px, float py, float pz,
|
||||
float vx, float xy, float xz,
|
||||
float fx, float fy, float fz,
|
||||
float ux, float uy, float uz);
|
||||
virtual void audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
|
||||
PN_stdfloat vx, PN_stdfloat xy, PN_stdfloat xz,
|
||||
PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz,
|
||||
PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz);
|
||||
|
||||
// REMOVE THIS ONE
|
||||
virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz,
|
||||
float *vx, float *vy, float *vz,
|
||||
float *fx, float *fy, float *fz,
|
||||
float *ux, float *uy, float *uz);
|
||||
virtual void audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz,
|
||||
PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz,
|
||||
PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz,
|
||||
PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz);
|
||||
|
||||
// Control the "relative distance factor" for 3D spacialized audio. Default is 1.0
|
||||
// Fmod uses meters internally, so give a float in Units-per meter
|
||||
// Don't know what Miles uses.
|
||||
virtual void audio_3d_set_distance_factor(float factor);
|
||||
virtual float audio_3d_get_distance_factor() const;
|
||||
virtual void audio_3d_set_distance_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_distance_factor() const;
|
||||
|
||||
// Control the presence of the Doppler effect. Default is 1.0
|
||||
// Exaggerated Doppler, use >1.0
|
||||
// Diminshed Doppler, use <1.0
|
||||
virtual void audio_3d_set_doppler_factor(float factor);
|
||||
virtual float audio_3d_get_doppler_factor() const;
|
||||
virtual void audio_3d_set_doppler_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_doppler_factor() const;
|
||||
|
||||
// Exaggerate or diminish the effect of distance on sound. Default is 1.0
|
||||
// Faster drop off, use >1.0
|
||||
// Slower drop off, use <1.0
|
||||
virtual void audio_3d_set_drop_off_factor(float factor);
|
||||
virtual float audio_3d_get_drop_off_factor() const;
|
||||
virtual void audio_3d_set_drop_off_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_drop_off_factor() const;
|
||||
|
||||
//THESE ARE NOT USED ANYMORE.
|
||||
//THEY ARE ONLY HERE BECAUSE THEY are still needed by Miles.
|
||||
|
|
@ -175,9 +175,9 @@ private:
|
|||
|
||||
static bool _system_is_valid;
|
||||
|
||||
static float _distance_factor;
|
||||
static float _doppler_factor;
|
||||
static float _drop_off_factor;
|
||||
static PN_stdfloat _distance_factor;
|
||||
static PN_stdfloat _doppler_factor;
|
||||
static PN_stdfloat _drop_off_factor;
|
||||
|
||||
FMOD::ChannelGroup *_channelgroup;
|
||||
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ get_loop_count() const {
|
|||
// immediatey.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_time(float start_time) {
|
||||
set_time(PN_stdfloat start_time) {
|
||||
_start_time = start_time;
|
||||
|
||||
if (status() == PLAYING) {
|
||||
|
|
@ -363,7 +363,7 @@ set_time(float start_time) {
|
|||
// Access: public
|
||||
// Description: Gets the play position within the sound
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
get_time() const {
|
||||
FMOD_RESULT result;
|
||||
unsigned int current_time;
|
||||
|
|
@ -382,13 +382,13 @@ get_time() const {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FmodAudioSound::set_volume(float vol)
|
||||
// Function: FmodAudioSound::set_volume(PN_stdfloat vol)
|
||||
// Access: public
|
||||
// Description: 0.0 to 1.0 scale of volume converted to Fmod's
|
||||
// internal 0.0 to 255.0 scale.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_volume(float vol) {
|
||||
set_volume(PN_stdfloat vol) {
|
||||
_volume = vol;
|
||||
set_volume_on_channel();
|
||||
}
|
||||
|
|
@ -398,7 +398,7 @@ set_volume(float vol) {
|
|||
// Access: public
|
||||
// Description: Gets the current volume of a sound. 1 is Max. O is Min.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
get_volume() const {
|
||||
return _volume;
|
||||
}
|
||||
|
|
@ -482,12 +482,12 @@ set_volume_on_channel() {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FmodAudioSound::set_balance(float bal)
|
||||
// Function: FmodAudioSound::set_balance(PN_stdfloat bal)
|
||||
// Access: public
|
||||
// Description: -1.0 to 1.0 scale
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_balance(float bal) {
|
||||
set_balance(PN_stdfloat bal) {
|
||||
_balance = bal;
|
||||
set_speaker_mix_or_balance_on_channel();
|
||||
}
|
||||
|
|
@ -499,13 +499,13 @@ set_balance(float bal) {
|
|||
// -1 should be all the way left.
|
||||
// 1 is all the way to the right.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
get_balance() const {
|
||||
return _balance;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FmodAudioSound::set_play_rate(float rate)
|
||||
// Function: FmodAudioSound::set_play_rate(PN_stdfloat rate)
|
||||
// Access: public
|
||||
// Description: Sets the speed at which a sound plays back.
|
||||
// The rate is a multiple of the sound, normal playback speed.
|
||||
|
|
@ -515,7 +515,7 @@ get_balance() const {
|
|||
// sound's time to its end to hear a song play backwards.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_play_rate(float rate) {
|
||||
set_play_rate(PN_stdfloat rate) {
|
||||
_playrate = rate;
|
||||
set_play_rate_on_channel();
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ set_play_rate(float rate) {
|
|||
// Access: public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
get_play_rate() const {
|
||||
return _playrate;
|
||||
}
|
||||
|
|
@ -538,7 +538,7 @@ get_play_rate() const {
|
|||
void FmodAudioSound::
|
||||
set_play_rate_on_channel() {
|
||||
FMOD_RESULT result;
|
||||
float frequency = _sampleFrequency * _playrate;
|
||||
PN_stdfloat frequency = _sampleFrequency * _playrate;
|
||||
|
||||
if (_channel != 0) {
|
||||
result = _channel->setFrequency( frequency );
|
||||
|
|
@ -566,7 +566,7 @@ get_name() const {
|
|||
// Description: Get length
|
||||
// FMOD returns the time in MS so we have to convert to seconds.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
length() const {
|
||||
FMOD_RESULT result;
|
||||
unsigned int length;
|
||||
|
|
@ -593,7 +593,7 @@ length() const {
|
|||
// I told you, so you can't say I didn't.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) {
|
||||
set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz) {
|
||||
_location.x = px;
|
||||
_location.y = pz;
|
||||
_location.z = py;
|
||||
|
|
@ -635,7 +635,7 @@ set_3d_attributes_on_channel() {
|
|||
// Currently unimplemented. Get the attributes of the attached object.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz) {
|
||||
get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz) {
|
||||
audio_error("get3dAttributes: Currently unimplemented. Get the attributes of the attached object.");
|
||||
}
|
||||
|
||||
|
|
@ -646,7 +646,7 @@ get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *
|
|||
// affects the rate it falls off.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_3d_min_distance(float dist) {
|
||||
set_3d_min_distance(PN_stdfloat dist) {
|
||||
FMOD_RESULT result;
|
||||
|
||||
_min_dist = dist;
|
||||
|
|
@ -660,7 +660,7 @@ set_3d_min_distance(float dist) {
|
|||
// Access: public
|
||||
// Description: Get the distance that this sound begins to fall off
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
get_3d_min_distance() const {
|
||||
return _min_dist;
|
||||
}
|
||||
|
|
@ -671,7 +671,7 @@ get_3d_min_distance() const {
|
|||
// Description: Set the distance that this sound stops falling off
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_3d_max_distance(float dist) {
|
||||
set_3d_max_distance(PN_stdfloat dist) {
|
||||
FMOD_RESULT result;
|
||||
|
||||
_max_dist = dist;
|
||||
|
|
@ -685,7 +685,7 @@ set_3d_max_distance(float dist) {
|
|||
// Access: public
|
||||
// Description: Get the distance that this sound stops falling off
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
get_3d_max_distance() const {
|
||||
return _max_dist;
|
||||
}
|
||||
|
|
@ -701,7 +701,7 @@ get_3d_max_distance() const {
|
|||
// BTW This will also work in Stereo speaker systems, but since
|
||||
// PANDA/FMOD has a balance [pan] function what is the point?
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float FmodAudioSound::
|
||||
PN_stdfloat FmodAudioSound::
|
||||
get_speaker_mix(AudioManager::SpeakerId speaker) {
|
||||
if (_channel == 0) {
|
||||
return 0.0;
|
||||
|
|
@ -750,7 +750,7 @@ get_speaker_mix(AudioManager::SpeakerId speaker) {
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void FmodAudioSound::
|
||||
set_speaker_mix(float frontleft, float frontright, float center, float sub, float backleft, float backright, float sideleft, float sideright) {
|
||||
set_speaker_mix(PN_stdfloat frontleft, PN_stdfloat frontright, PN_stdfloat center, PN_stdfloat sub, PN_stdfloat backleft, PN_stdfloat backright, PN_stdfloat sideleft, PN_stdfloat sideright) {
|
||||
_mix[AudioManager::SPK_frontleft] = frontleft;
|
||||
_mix[AudioManager::SPK_frontright] = frontright;
|
||||
_mix[AudioManager::SPK_center] = center;
|
||||
|
|
|
|||
|
|
@ -105,47 +105,47 @@ class EXPCL_FMOD_AUDIO FmodAudioSound : public AudioSound {
|
|||
|
||||
// 0 = beginning; length() = end.
|
||||
// inits to 0.0.
|
||||
void set_time(float start_time=0.0);
|
||||
float get_time() const;
|
||||
void set_time(PN_stdfloat start_time=0.0);
|
||||
PN_stdfloat get_time() const;
|
||||
|
||||
// 0 = minimum; 1.0 = maximum.
|
||||
// inits to 1.0.
|
||||
void set_volume(float volume=1.0);
|
||||
float get_volume() const;
|
||||
void set_volume(PN_stdfloat volume=1.0);
|
||||
PN_stdfloat get_volume() const;
|
||||
|
||||
// -1.0 is hard left
|
||||
// 0.0 is centered
|
||||
// 1.0 is hard right
|
||||
// inits to 0.0.
|
||||
void set_balance(float balance_right=0.0);
|
||||
float get_balance() const;
|
||||
void set_balance(PN_stdfloat balance_right=0.0);
|
||||
PN_stdfloat get_balance() const;
|
||||
|
||||
// play_rate is any positive float value.
|
||||
// inits to 1.0.
|
||||
void set_play_rate(float play_rate=1.0f);
|
||||
float get_play_rate() const;
|
||||
void set_play_rate(PN_stdfloat play_rate=1.0f);
|
||||
PN_stdfloat get_play_rate() const;
|
||||
|
||||
const string &get_name() const;
|
||||
|
||||
// return: playing time in seconds.
|
||||
float length() const;
|
||||
PN_stdfloat length() const;
|
||||
|
||||
// Controls the position of this sound's emitter.
|
||||
// pos is a pointer to an xyz triplet of the emitter's position.
|
||||
// vel is a pointer to an xyz triplet of the emitter's velocity.
|
||||
void set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz);
|
||||
void get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz);
|
||||
void set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz);
|
||||
void get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz);
|
||||
|
||||
void set_3d_min_distance(float dist);
|
||||
float get_3d_min_distance() const;
|
||||
void set_3d_min_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_min_distance() const;
|
||||
|
||||
void set_3d_max_distance(float dist);
|
||||
float get_3d_max_distance() const;
|
||||
void set_3d_max_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_max_distance() const;
|
||||
|
||||
AudioSound::SoundStatus status() const;
|
||||
|
||||
virtual float get_speaker_mix(AudioManager::SpeakerId speaker);
|
||||
virtual void set_speaker_mix(float frontleft, float frontright, float center, float sub, float backleft, float backright, float sideleft, float sideright);
|
||||
virtual PN_stdfloat get_speaker_mix(AudioManager::SpeakerId speaker);
|
||||
virtual void set_speaker_mix(PN_stdfloat frontleft, PN_stdfloat frontright, PN_stdfloat center, PN_stdfloat sub, PN_stdfloat backleft, PN_stdfloat backright, PN_stdfloat sideleft, PN_stdfloat sideright);
|
||||
|
||||
void set_active(bool active=true);
|
||||
bool get_active() const;
|
||||
|
|
@ -175,8 +175,8 @@ class EXPCL_FMOD_AUDIO FmodAudioSound : public AudioSound {
|
|||
FMOD_VECTOR _location;
|
||||
FMOD_VECTOR _velocity;
|
||||
|
||||
float _min_dist;
|
||||
float _max_dist;
|
||||
PN_stdfloat _min_dist;
|
||||
PN_stdfloat _max_dist;
|
||||
|
||||
void start_playing();
|
||||
void set_volume_on_channel();
|
||||
|
|
@ -192,7 +192,7 @@ class EXPCL_FMOD_AUDIO FmodAudioSound : public AudioSound {
|
|||
|
||||
bool _active;
|
||||
bool _paused;
|
||||
float _start_time;
|
||||
PN_stdfloat _start_time;
|
||||
|
||||
string _finished_event;
|
||||
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ get_cache_limit() const {
|
|||
// Description: set the overall volume
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::
|
||||
set_volume(float volume) {
|
||||
set_volume(PN_stdfloat volume) {
|
||||
audio_debug("MilesAudioManager::set_volume(volume="<<volume<<")");
|
||||
LightReMutexHolder holder(_lock);
|
||||
if (_volume != volume) {
|
||||
|
|
@ -322,7 +322,7 @@ set_volume(float volume) {
|
|||
// Access: Public, Virtual
|
||||
// Description: get the overall volume
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioManager::
|
||||
PN_stdfloat MilesAudioManager::
|
||||
get_volume() const {
|
||||
return _volume;
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@ get_volume() const {
|
|||
// Description: set the overall play rate
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::
|
||||
set_play_rate(float play_rate) {
|
||||
set_play_rate(PN_stdfloat play_rate) {
|
||||
audio_debug("MilesAudioManager::set_play_rate(play_rate="<<play_rate<<")");
|
||||
LightReMutexHolder holder(_lock);
|
||||
if (_play_rate != play_rate) {
|
||||
|
|
@ -351,7 +351,7 @@ set_play_rate(float play_rate) {
|
|||
// Access: Public
|
||||
// Description: get the overall speed/pitch/play rate
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioManager::
|
||||
PN_stdfloat MilesAudioManager::
|
||||
get_play_rate() const {
|
||||
return _play_rate;
|
||||
}
|
||||
|
|
@ -440,7 +440,7 @@ stop_all_sounds() {
|
|||
// sounds. Note that Y and Z are switched to
|
||||
// translate into Miles's coordinate system.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) {
|
||||
void MilesAudioManager::audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz, PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz, PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz) {
|
||||
audio_debug("MilesAudioManager::audio_3d_set_listener_attributes()");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -456,13 +456,27 @@ void MilesAudioManager::audio_3d_set_listener_attributes(float px, float py, flo
|
|||
// sounds. Note that Y and Z are switched to
|
||||
// translate from Miles's coordinate system.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) {
|
||||
void MilesAudioManager::audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz, PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz, PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz) {
|
||||
audio_debug("MilesAudioManager::audio_3d_get_listener_attributes()");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
AIL_listener_3D_position(mgr->_digital_driver, px, pz, py);
|
||||
AIL_listener_3D_velocity(mgr->_digital_driver, vx, vz, vy);
|
||||
AIL_listener_3D_orientation(mgr->_digital_driver, fx, fz, fy, ux, uz, uy);
|
||||
float lpx, lpy, lpz, lvx, lvy, lvz, lfx, lfy, lfz, lux, luy, luz;
|
||||
AIL_listener_3D_position(mgr->_digital_driver, &lpx, &lpz, &lpy);
|
||||
AIL_listener_3D_velocity(mgr->_digital_driver, &lvx, &lvz, &lvy);
|
||||
AIL_listener_3D_orientation(mgr->_digital_driver, &lfx, &lfz, &lfy, &lux, &luz, &luy);
|
||||
|
||||
*px = lpx;
|
||||
*py = lpy;
|
||||
*pz = lpz;
|
||||
*vx = lvx;
|
||||
*vy = lvy;
|
||||
*vz = lvz;
|
||||
*fx = lfx;
|
||||
*fy = lfy;
|
||||
*fz = lfz;
|
||||
*ux = lux;
|
||||
*uy = luy;
|
||||
*uz = luz;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -471,7 +485,7 @@ void MilesAudioManager::audio_3d_get_listener_attributes(float *px, float *py, f
|
|||
// Description: Set factor to allow user to easily work in a
|
||||
// different scale. 1.0 represents meters.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::audio_3d_set_distance_factor(float factor) {
|
||||
void MilesAudioManager::audio_3d_set_distance_factor(PN_stdfloat factor) {
|
||||
audio_debug("MilesAudioManager::audio_3d_set_distance_factor( factor= " << factor << ")");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -483,7 +497,7 @@ void MilesAudioManager::audio_3d_set_distance_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description: Get factor controlling working units.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioManager::audio_3d_get_distance_factor() const {
|
||||
PN_stdfloat MilesAudioManager::audio_3d_get_distance_factor() const {
|
||||
audio_debug("MilesAudioManager::audio_3d_get_distance_factor()");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -496,7 +510,7 @@ float MilesAudioManager::audio_3d_get_distance_factor() const {
|
|||
// Description: Exaggerates or diminishes the Doppler effect.
|
||||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::audio_3d_set_doppler_factor(float factor) {
|
||||
void MilesAudioManager::audio_3d_set_doppler_factor(PN_stdfloat factor) {
|
||||
audio_debug("MilesAudioManager::audio_3d_set_doppler_factor(factor="<<factor<<")");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -508,7 +522,7 @@ void MilesAudioManager::audio_3d_set_doppler_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description: Get the factor controlling the Doppler effect.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioManager::audio_3d_get_doppler_factor() const {
|
||||
PN_stdfloat MilesAudioManager::audio_3d_get_doppler_factor() const {
|
||||
audio_debug("MilesAudioManager::audio_3d_get_doppler_factor()");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -521,7 +535,7 @@ float MilesAudioManager::audio_3d_get_doppler_factor() const {
|
|||
// Description: Control the effect distance has on audability.
|
||||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::audio_3d_set_drop_off_factor(float factor) {
|
||||
void MilesAudioManager::audio_3d_set_drop_off_factor(PN_stdfloat factor) {
|
||||
audio_debug("MilesAudioManager::audio_3d_set_drop_off_factor("<<factor<<")");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -534,7 +548,7 @@ void MilesAudioManager::audio_3d_set_drop_off_factor(float factor) {
|
|||
// Description: Get the factor controlling how quickly sound falls
|
||||
// off with distance.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioManager::audio_3d_get_drop_off_factor() const {
|
||||
PN_stdfloat MilesAudioManager::audio_3d_get_drop_off_factor() const {
|
||||
audio_debug("MilesAudioManager::audio_3d_get_drop_off_factor()");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -554,7 +568,7 @@ float MilesAudioManager::audio_3d_get_drop_off_factor() const {
|
|||
// coordinate system.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::
|
||||
set_speaker_configuration(LVecBase3f *speaker1, LVecBase3f *speaker2, LVecBase3f *speaker3, LVecBase3f *speaker4, LVecBase3f *speaker5, LVecBase3f *speaker6, LVecBase3f *speaker7, LVecBase3f *speaker8, LVecBase3f *speaker9) {
|
||||
set_speaker_configuration(LVecBase3 *speaker1, LVecBase3 *speaker2, LVecBase3 *speaker3, LVecBase3 *speaker4, LVecBase3 *speaker5, LVecBase3 *speaker6, LVecBase3 *speaker7, LVecBase3 *speaker8, LVecBase3 *speaker9) {
|
||||
audio_debug("MilesAudioManager::set_speaker_configuration()");
|
||||
|
||||
GlobalMilesManager *mgr = GlobalMilesManager::get_global_ptr();
|
||||
|
|
@ -1176,7 +1190,7 @@ MilesAudioManager::SoundData::
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioManager::SoundData::
|
||||
PN_stdfloat MilesAudioManager::SoundData::
|
||||
get_length() {
|
||||
if (!_has_length) {
|
||||
// Time to determine the length of the file.
|
||||
|
|
@ -1205,7 +1219,7 @@ get_length() {
|
|||
|
||||
AILSOUNDINFO info;
|
||||
if (AIL_WAV_info(&_raw_data[0], &info)) {
|
||||
_length = (float)info.samples / (float)info.rate;
|
||||
_length = (PN_stdfloat)info.samples / (PN_stdfloat)info.rate;
|
||||
audio_debug(info.samples << " samples at " << info.rate
|
||||
<< "; length is " << _length << " seconds.");
|
||||
_has_length = true;
|
||||
|
|
@ -1223,7 +1237,7 @@ get_length() {
|
|||
// Description: Records the sample length, as determined externally.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioManager::SoundData::
|
||||
set_length(float length) {
|
||||
set_length(PN_stdfloat length) {
|
||||
_length = length;
|
||||
_has_length = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ public:
|
|||
virtual void set_cache_limit(unsigned int count);
|
||||
virtual unsigned int get_cache_limit() const;
|
||||
|
||||
virtual void set_volume(float volume);
|
||||
virtual float get_volume() const;
|
||||
virtual void set_volume(PN_stdfloat volume);
|
||||
virtual PN_stdfloat get_volume() const;
|
||||
|
||||
void set_play_rate(float play_rate);
|
||||
float get_play_rate() const;
|
||||
void set_play_rate(PN_stdfloat play_rate);
|
||||
PN_stdfloat get_play_rate() const;
|
||||
|
||||
virtual void set_active(bool active);
|
||||
virtual bool get_active() const;
|
||||
|
|
@ -75,15 +75,15 @@ public:
|
|||
// Spatialized sound was originally added for FMOD, so there are parts of the
|
||||
// interface in the Miles implementation that are a little more awkward than
|
||||
// they would be otherwise.
|
||||
virtual void audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float xy, float xz, float fx, float fy, float fz, float ux, float uy, float uz);
|
||||
virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz);
|
||||
virtual void audio_3d_set_distance_factor(float factor);
|
||||
virtual float audio_3d_get_distance_factor() const;
|
||||
virtual void audio_3d_set_doppler_factor(float factor);
|
||||
virtual float audio_3d_get_doppler_factor() const;
|
||||
virtual void audio_3d_set_drop_off_factor(float factor);
|
||||
virtual float audio_3d_get_drop_off_factor() const;
|
||||
virtual void set_speaker_configuration(LVecBase3f *speaker1, LVecBase3f *speaker2=NULL, LVecBase3f *speaker3=NULL, LVecBase3f *speaker4=NULL, LVecBase3f *speaker5=NULL, LVecBase3f *speaker6=NULL, LVecBase3f *speaker7=NULL, LVecBase3f *speaker8=NULL, LVecBase3f *speaker9=NULL);
|
||||
virtual void audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat xy, PN_stdfloat xz, PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz, PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz);
|
||||
virtual void audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz, PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz, PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz);
|
||||
virtual void audio_3d_set_distance_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_distance_factor() const;
|
||||
virtual void audio_3d_set_doppler_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_doppler_factor() const;
|
||||
virtual void audio_3d_set_drop_off_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_drop_off_factor() const;
|
||||
virtual void set_speaker_configuration(LVecBase3 *speaker1, LVecBase3 *speaker2=NULL, LVecBase3 *speaker3=NULL, LVecBase3 *speaker4=NULL, LVecBase3 *speaker5=NULL, LVecBase3 *speaker6=NULL, LVecBase3 *speaker7=NULL, LVecBase3 *speaker8=NULL, LVecBase3 *speaker9=NULL);
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
virtual void write(ostream &out) const;
|
||||
|
|
@ -123,14 +123,14 @@ private:
|
|||
public:
|
||||
SoundData();
|
||||
~SoundData();
|
||||
float get_length();
|
||||
void set_length(float length);
|
||||
PN_stdfloat get_length();
|
||||
void set_length(PN_stdfloat length);
|
||||
|
||||
Filename _basename;
|
||||
S32 _file_type;
|
||||
pvector<unsigned char> _raw_data;
|
||||
bool _has_length;
|
||||
float _length; // in seconds.
|
||||
PN_stdfloat _length; // in seconds.
|
||||
};
|
||||
typedef pmap<string, PT(SoundData) > SoundMap;
|
||||
SoundMap _sounds;
|
||||
|
|
@ -147,8 +147,8 @@ private:
|
|||
typedef pdeque<const string *> LRU;
|
||||
LRU _lru;
|
||||
// State:
|
||||
float _volume;
|
||||
float _play_rate;
|
||||
PN_stdfloat _volume;
|
||||
PN_stdfloat _play_rate;
|
||||
bool _active;
|
||||
int _cache_limit;
|
||||
bool _cleanup_required;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ stop() {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSample::
|
||||
PN_stdfloat MilesAudioSample::
|
||||
get_time() const {
|
||||
if (_sample == 0) {
|
||||
if (_got_start_time) {
|
||||
|
|
@ -165,7 +165,7 @@ get_time() const {
|
|||
|
||||
S32 current_ms;
|
||||
AIL_sample_ms_position(_sample, NULL, ¤t_ms);
|
||||
float time = float(current_ms * 0.001f);
|
||||
PN_stdfloat time = PN_stdfloat(current_ms * 0.001f);
|
||||
|
||||
return time;
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ get_time() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::
|
||||
set_volume(float volume) {
|
||||
set_volume(PN_stdfloat volume) {
|
||||
miles_audio_debug("set_volume(volume="<<volume<<")");
|
||||
|
||||
// Set the volume even if our volume is not changing, because the
|
||||
|
|
@ -207,7 +207,7 @@ set_volume(float volume) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::
|
||||
set_balance(float balance_right) {
|
||||
set_balance(PN_stdfloat balance_right) {
|
||||
miles_audio_debug("set_balance(balance_right="<<balance_right<<")");
|
||||
_balance = balance_right;
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ set_balance(float balance_right) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::
|
||||
set_play_rate(float play_rate) {
|
||||
set_play_rate(PN_stdfloat play_rate) {
|
||||
miles_audio_debug("set_play_rate(play_rate="<<play_rate<<")");
|
||||
|
||||
// Set the play_rate:
|
||||
|
|
@ -231,7 +231,7 @@ set_play_rate(float play_rate) {
|
|||
play_rate *= _manager->get_play_rate();
|
||||
|
||||
// wave and mp3 use sample rate (e.g. 44100)
|
||||
S32 speed = (S32)(play_rate * (float)_original_playback_rate);
|
||||
S32 speed = (S32)(play_rate * (PN_stdfloat)_original_playback_rate);
|
||||
AIL_set_sample_playback_rate(_sample, speed);
|
||||
audio_debug(" play_rate for this wav or mp3 is now " << speed);
|
||||
}
|
||||
|
|
@ -242,7 +242,7 @@ set_play_rate(float play_rate) {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSample::
|
||||
PN_stdfloat MilesAudioSample::
|
||||
length() const {
|
||||
return _sd->get_length();
|
||||
}
|
||||
|
|
@ -311,7 +311,7 @@ output(ostream &out) const {
|
|||
// Y and Z are switched to translate from Miles's
|
||||
// coordinate system.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) {
|
||||
void MilesAudioSample::set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz) {
|
||||
audio_debug("MilesAudioSample::set_3d_attributes() Setting a sound's 3D Coordinates.");
|
||||
|
||||
if(_sample != 0) {
|
||||
|
|
@ -327,12 +327,19 @@ void MilesAudioSample::set_3d_attributes(float px, float py, float pz, float vx,
|
|||
// Access: public
|
||||
// Description: Get position and velocity of this sound.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz) {
|
||||
void MilesAudioSample::get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz) {
|
||||
audio_debug("MilesAudioSample::get_3d_attributes().");
|
||||
|
||||
if(_sample != 0) {
|
||||
AIL_sample_3D_position(_sample, px, pz, py);
|
||||
AIL_sample_3D_velocity(_sample, vx, vz, vy);
|
||||
float lpx, lpy, lpz, lvx, lvy, lvz;
|
||||
AIL_sample_3D_position(_sample, &lpx, &lpz, &lpy);
|
||||
AIL_sample_3D_velocity(_sample, &lvx, &lvz, &lvy);
|
||||
*px = lpx;
|
||||
*py = lpy;
|
||||
*pz = lpz;
|
||||
*vx = lvx;
|
||||
*vy = lvy;
|
||||
*vz = lvz;
|
||||
} else {
|
||||
audio_warning("_sample == 0 in MilesAudioSample::get_3d_attributes().");
|
||||
}
|
||||
|
|
@ -346,7 +353,7 @@ void MilesAudioSample::get_3d_attributes(float *px, float *py, float *pz, float
|
|||
// the distance between the sound and the listener is
|
||||
// doubled, the volume is halved, and vice versa.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::set_3d_min_distance(float dist) {
|
||||
void MilesAudioSample::set_3d_min_distance(PN_stdfloat dist) {
|
||||
audio_debug("MilesAudioSample::set_3d_min_distance() Setting the sound's 3D min distance ( min= " << dist << " ) ");
|
||||
|
||||
if(_sample != 0) {
|
||||
|
|
@ -367,13 +374,13 @@ void MilesAudioSample::set_3d_min_distance(float dist) {
|
|||
// Access: public
|
||||
// Description: Get the distance that this sound begins to fall off.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSample::get_3d_min_distance() const {
|
||||
PN_stdfloat MilesAudioSample::get_3d_min_distance() const {
|
||||
audio_debug("MilesAudioSample::get_3d_min_distance() ");
|
||||
|
||||
if(_sample != 0) {
|
||||
float min_dist;
|
||||
AIL_sample_3D_distances(_sample, NULL, &min_dist, NULL);
|
||||
return min_dist;
|
||||
return (PN_stdfloat)min_dist;
|
||||
} else {
|
||||
audio_warning("_sample == 0 in MilesAudioSample::get_3d_min_distance().");
|
||||
return -1.0;
|
||||
|
|
@ -388,7 +395,7 @@ float MilesAudioSample::get_3d_min_distance() const {
|
|||
// the rate at which the sound falls off, but only
|
||||
// the distance at which it gets clipped.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::set_3d_max_distance(float dist) {
|
||||
void MilesAudioSample::set_3d_max_distance(PN_stdfloat dist) {
|
||||
audio_debug("MilesAudioSample::set_3d_max_distance() Setting the sound's 3D max distance ( max= " << dist << " ) ");
|
||||
|
||||
if(_sample != 0) {
|
||||
|
|
@ -410,13 +417,13 @@ void MilesAudioSample::set_3d_max_distance(float dist) {
|
|||
// Description: Get the distance at which this sound is clipped to
|
||||
// silence.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSample::get_3d_max_distance() const {
|
||||
PN_stdfloat MilesAudioSample::get_3d_max_distance() const {
|
||||
audio_debug("MilesAudioSample::get_3d_max_distance() ");
|
||||
|
||||
if(_sample != 0) {
|
||||
float max_dist;
|
||||
AIL_sample_3D_distances(_sample, &max_dist, NULL, NULL);
|
||||
return max_dist;
|
||||
return (PN_stdfloat)max_dist;
|
||||
} else {
|
||||
audio_warning("_sample == 0 in MilesAudioSample::get_3d_max_distance().");
|
||||
return -1.0;
|
||||
|
|
@ -459,7 +466,7 @@ float MilesAudioSample::get_3d_max_distance() const {
|
|||
// TOP_BACK_RIGHT
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSample::
|
||||
PN_stdfloat MilesAudioSample::
|
||||
get_speaker_level(int index) {
|
||||
audio_debug("MilesAudioSample::get_speaker_level(" << index << ")");
|
||||
|
||||
|
|
@ -468,7 +475,7 @@ get_speaker_level(int index) {
|
|||
float *levels = AIL_sample_channel_levels(_sample, &numLevels);
|
||||
|
||||
if(index < numLevels) {
|
||||
return levels[index];
|
||||
return (PN_stdfloat)levels[index];
|
||||
} else {
|
||||
audio_error("index out of range in MilesAudioSample::get_speaker_level. numLevels: " << numLevels);
|
||||
return -1.0;
|
||||
|
|
@ -519,7 +526,7 @@ get_speaker_level(int index) {
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::
|
||||
set_speaker_levels(float level1, float level2, float level3, float level4, float level5, float level6, float level7, float level8, float level9) {
|
||||
set_speaker_levels(PN_stdfloat level1, PN_stdfloat level2, PN_stdfloat level3, PN_stdfloat level4, PN_stdfloat level5, PN_stdfloat level6, PN_stdfloat level7, PN_stdfloat level8, PN_stdfloat level9) {
|
||||
audio_debug("MilesAudioSample::set_speaker_levels()");
|
||||
|
||||
if(_sample != 0) {
|
||||
|
|
@ -589,12 +596,12 @@ finish_callback(HSAMPLE sample) {
|
|||
// Description: Sets the start time of an already allocated sample.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSample::
|
||||
do_set_time(float time) {
|
||||
do_set_time(PN_stdfloat time) {
|
||||
miles_audio_debug("do_set_time(time="<<time<<")");
|
||||
nassertv(_sample != 0);
|
||||
|
||||
// Ensure we don't inadvertently run off the end of the sound.
|
||||
float max_time = length();
|
||||
PN_stdfloat max_time = length();
|
||||
if (time > max_time) {
|
||||
milesAudio_cat.warning()
|
||||
<< "set_time(" << time << ") requested for sound of length "
|
||||
|
|
|
|||
|
|
@ -40,13 +40,13 @@ public:
|
|||
virtual void play();
|
||||
virtual void stop();
|
||||
|
||||
virtual float get_time() const;
|
||||
virtual PN_stdfloat get_time() const;
|
||||
|
||||
virtual void set_volume(float volume=1.0f);
|
||||
virtual void set_balance(float balance_right=0.0f);
|
||||
virtual void set_play_rate(float play_rate=1.0f);
|
||||
virtual void set_volume(PN_stdfloat volume=1.0f);
|
||||
virtual void set_balance(PN_stdfloat balance_right=0.0f);
|
||||
virtual void set_play_rate(PN_stdfloat play_rate=1.0f);
|
||||
|
||||
virtual float length() const;
|
||||
virtual PN_stdfloat length() const;
|
||||
|
||||
virtual AudioSound::SoundStatus status() const;
|
||||
|
||||
|
|
@ -57,20 +57,20 @@ public:
|
|||
// Spatialized sound was originally added for FMOD, so there are parts of the
|
||||
// interface in the Miles implementation that are a little more awkward than
|
||||
// they would be otherwise.
|
||||
void set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz);
|
||||
void get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz);
|
||||
void set_3d_min_distance(float dist);
|
||||
float get_3d_min_distance() const;
|
||||
void set_3d_max_distance(float dist);
|
||||
float get_3d_max_distance() const;
|
||||
void set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz);
|
||||
void get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz);
|
||||
void set_3d_min_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_min_distance() const;
|
||||
void set_3d_max_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_max_distance() const;
|
||||
|
||||
virtual float get_speaker_level(int index);
|
||||
virtual void set_speaker_levels(float level1, float level2=-1.0f, float level3=-1.0f, float level4=-1.0f, float level5=-1.0f, float level6=-1.0f, float level7=-1.0f, float level8=-1.0f, float level9=-1.0f);
|
||||
virtual PN_stdfloat get_speaker_level(int index);
|
||||
virtual void set_speaker_levels(PN_stdfloat level1, PN_stdfloat level2=-1.0f, PN_stdfloat level3=-1.0f, PN_stdfloat level4=-1.0f, PN_stdfloat level5=-1.0f, PN_stdfloat level6=-1.0f, PN_stdfloat level7=-1.0f, PN_stdfloat level8=-1.0f, PN_stdfloat level9=-1.0f);
|
||||
|
||||
private:
|
||||
void internal_stop();
|
||||
static void AILCALLBACK finish_callback(HSAMPLE sample);
|
||||
void do_set_time(float time);
|
||||
void do_set_time(PN_stdfloat time);
|
||||
|
||||
PT(MilesAudioManager::SoundData) _sd;
|
||||
HSAMPLE _sample;
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ stop() {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSequence::
|
||||
PN_stdfloat MilesAudioSequence::
|
||||
get_time() const {
|
||||
if (_sequence == 0) {
|
||||
if (_got_start_time) {
|
||||
|
|
@ -155,7 +155,7 @@ get_time() const {
|
|||
|
||||
S32 current_ms;
|
||||
AIL_sequence_ms_position(_sequence, NULL, ¤t_ms);
|
||||
float time = float(current_ms * 0.001f);
|
||||
PN_stdfloat time = PN_stdfloat(current_ms * 0.001f);
|
||||
|
||||
return time;
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@ get_time() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSequence::
|
||||
set_volume(float volume) {
|
||||
set_volume(PN_stdfloat volume) {
|
||||
miles_audio_debug("set_volume(volume="<<volume<<")");
|
||||
|
||||
// Set the volume even if our volume is not changing, because the
|
||||
|
|
@ -194,7 +194,7 @@ set_volume(float volume) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSequence::
|
||||
set_balance(float balance_right) {
|
||||
set_balance(PN_stdfloat balance_right) {
|
||||
miles_audio_debug("set_balance(balance_right="<<balance_right<<")");
|
||||
_balance = balance_right;
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ set_balance(float balance_right) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSequence::
|
||||
set_play_rate(float play_rate) {
|
||||
set_play_rate(PN_stdfloat play_rate) {
|
||||
miles_audio_debug("set_play_rate(play_rate="<<play_rate<<")");
|
||||
|
||||
// Set the play_rate:
|
||||
|
|
@ -226,7 +226,7 @@ set_play_rate(float play_rate) {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSequence::
|
||||
PN_stdfloat MilesAudioSequence::
|
||||
length() const {
|
||||
if (_sequence == 0) {
|
||||
// The MIDI file hasn't been started yet. See if the length is
|
||||
|
|
@ -244,7 +244,7 @@ length() const {
|
|||
// directly.
|
||||
S32 length_ms;
|
||||
AIL_sequence_ms_position(_sequence, &length_ms, NULL);
|
||||
float time = (float)length_ms * 0.001f;
|
||||
PN_stdfloat time = (PN_stdfloat)length_ms * 0.001f;
|
||||
return time;
|
||||
}
|
||||
|
||||
|
|
@ -320,7 +320,7 @@ finish_callback(HSEQUENCE sequence) {
|
|||
// Description: Sets the start time of an already allocated stream.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSequence::
|
||||
do_set_time(float time) {
|
||||
do_set_time(PN_stdfloat time) {
|
||||
miles_audio_debug("do_set_time(time="<<time<<")");
|
||||
|
||||
nassertv(_sequence != 0);
|
||||
|
|
@ -355,7 +355,7 @@ determine_length() {
|
|||
AIL_init_sequence(_sequence, &_sd->_raw_data[0], 0);
|
||||
S32 length_ms;
|
||||
AIL_sequence_ms_position(_sequence, &length_ms, NULL);
|
||||
float time = (float)length_ms * 0.001f;
|
||||
PN_stdfloat time = (PN_stdfloat)length_ms * 0.001f;
|
||||
mgr->release_sequence(_sequence_index, this);
|
||||
_sequence = 0;
|
||||
_sequence_index = 0;
|
||||
|
|
|
|||
|
|
@ -39,13 +39,13 @@ public:
|
|||
virtual void play();
|
||||
virtual void stop();
|
||||
|
||||
virtual float get_time() const;
|
||||
virtual PN_stdfloat get_time() const;
|
||||
|
||||
virtual void set_volume(float volume=1.0f);
|
||||
virtual void set_balance(float balance_right=0.0f);
|
||||
virtual void set_play_rate(float play_rate=1.0f);
|
||||
virtual void set_volume(PN_stdfloat volume=1.0f);
|
||||
virtual void set_balance(PN_stdfloat balance_right=0.0f);
|
||||
virtual void set_play_rate(PN_stdfloat play_rate=1.0f);
|
||||
|
||||
virtual float length() const;
|
||||
virtual PN_stdfloat length() const;
|
||||
|
||||
virtual AudioSound::SoundStatus status() const;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ public:
|
|||
private:
|
||||
void internal_stop();
|
||||
static void AILCALLBACK finish_callback(HSEQUENCE sequence);
|
||||
void do_set_time(float time);
|
||||
void do_set_time(PN_stdfloat time);
|
||||
void determine_length();
|
||||
|
||||
PT(MilesAudioManager::SoundData) _sd;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ get_loop_count() const {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSound::
|
||||
PN_stdfloat MilesAudioSound::
|
||||
get_volume() const {
|
||||
return _volume;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ get_volume() const {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSound::
|
||||
PN_stdfloat MilesAudioSound::
|
||||
get_balance() const {
|
||||
return _balance;
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ get_balance() const {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioSound::
|
||||
PN_stdfloat MilesAudioSound::
|
||||
get_play_rate() const {
|
||||
return _play_rate;
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ get_play_rate() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioSound::
|
||||
set_time(float time) {
|
||||
set_time(PN_stdfloat time) {
|
||||
miles_audio_debug("set_time(time="<<time<<")");
|
||||
|
||||
// Mark this position for the next play().
|
||||
|
|
|
|||
|
|
@ -38,11 +38,11 @@ public:
|
|||
virtual void set_loop_count(unsigned long loop_count=1);
|
||||
virtual unsigned long get_loop_count() const;
|
||||
|
||||
virtual float get_volume() const;
|
||||
virtual float get_balance() const;
|
||||
virtual float get_play_rate() const;
|
||||
virtual PN_stdfloat get_volume() const;
|
||||
virtual PN_stdfloat get_balance() const;
|
||||
virtual PN_stdfloat get_play_rate() const;
|
||||
|
||||
virtual void set_time(float start_time=0.0);
|
||||
virtual void set_time(PN_stdfloat start_time=0.0);
|
||||
|
||||
virtual void set_active(bool active=true);
|
||||
virtual bool get_active() const;
|
||||
|
|
@ -58,9 +58,9 @@ protected:
|
|||
PT(MilesAudioManager) _manager;
|
||||
string _file_name;
|
||||
|
||||
float _volume; // 0..1.0
|
||||
float _balance; // -1..1
|
||||
float _play_rate; // 0..1.0
|
||||
PN_stdfloat _volume; // 0..1.0
|
||||
PN_stdfloat _balance; // -1..1
|
||||
PN_stdfloat _play_rate; // 0..1.0
|
||||
unsigned long _loop_count;
|
||||
|
||||
// _active is for things like a 'turn off sound effects' in
|
||||
|
|
@ -81,7 +81,7 @@ protected:
|
|||
|
||||
// This is set whenever we call set_time(). Calling play() will
|
||||
// respect this if it is set, and then reset it.
|
||||
float _start_time;
|
||||
PN_stdfloat _start_time;
|
||||
bool _got_start_time;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ stop() {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioStream::
|
||||
PN_stdfloat MilesAudioStream::
|
||||
get_time() const {
|
||||
if (_stream == 0) {
|
||||
if (_got_start_time) {
|
||||
|
|
@ -165,7 +165,7 @@ get_time() const {
|
|||
|
||||
S32 current_ms;
|
||||
AIL_stream_ms_position(_stream, NULL, ¤t_ms);
|
||||
float time = float(current_ms * 0.001f);
|
||||
PN_stdfloat time = PN_stdfloat(current_ms * 0.001f);
|
||||
|
||||
return time;
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ get_time() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioStream::
|
||||
set_volume(float volume) {
|
||||
set_volume(PN_stdfloat volume) {
|
||||
_volume = volume;
|
||||
|
||||
if (_stream != 0) {
|
||||
|
|
@ -203,7 +203,7 @@ set_volume(float volume) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioStream::
|
||||
set_balance(float balance_right) {
|
||||
set_balance(PN_stdfloat balance_right) {
|
||||
_balance = balance_right;
|
||||
|
||||
// Call set_volume to effect the change:
|
||||
|
|
@ -216,7 +216,7 @@ set_balance(float balance_right) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioStream::
|
||||
set_play_rate(float play_rate) {
|
||||
set_play_rate(PN_stdfloat play_rate) {
|
||||
_play_rate = play_rate;
|
||||
|
||||
if (_stream != 0) {
|
||||
|
|
@ -226,7 +226,7 @@ set_play_rate(float play_rate) {
|
|||
play_rate *= _manager->get_play_rate();
|
||||
|
||||
// wave and mp3 use sample rate (e.g. 44100)
|
||||
S32 speed = (S32)(play_rate * (float)_original_playback_rate);
|
||||
S32 speed = (S32)(play_rate * (PN_stdfloat)_original_playback_rate);
|
||||
AIL_set_sample_playback_rate(sample, speed);
|
||||
audio_debug(" play_rate for this wav or mp3 is now " << speed);
|
||||
}
|
||||
|
|
@ -237,7 +237,7 @@ set_play_rate(float play_rate) {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float MilesAudioStream::
|
||||
PN_stdfloat MilesAudioStream::
|
||||
length() const {
|
||||
if (!_got_length) {
|
||||
if (_stream == 0) {
|
||||
|
|
@ -247,7 +247,7 @@ length() const {
|
|||
|
||||
S32 length_ms;
|
||||
AIL_stream_ms_position(_stream, &length_ms, NULL);
|
||||
_length = (float)length_ms * 0.001f;
|
||||
_length = (PN_stdfloat)length_ms * 0.001f;
|
||||
_got_length = true;
|
||||
}
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ finish_callback(HSTREAM stream) {
|
|||
// Description: Sets the start time of an already allocated stream.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void MilesAudioStream::
|
||||
do_set_time(float time) {
|
||||
do_set_time(PN_stdfloat time) {
|
||||
nassertv(_stream != 0);
|
||||
|
||||
S32 time_ms = (S32)(1000.0f * time);
|
||||
|
|
|
|||
|
|
@ -40,13 +40,13 @@ public:
|
|||
virtual void play();
|
||||
virtual void stop();
|
||||
|
||||
virtual float get_time() const;
|
||||
virtual PN_stdfloat get_time() const;
|
||||
|
||||
virtual void set_volume(float volume=1.0f);
|
||||
virtual void set_balance(float balance_right=0.0f);
|
||||
virtual void set_play_rate(float play_rate=1.0f);
|
||||
virtual void set_volume(PN_stdfloat volume=1.0f);
|
||||
virtual void set_balance(PN_stdfloat balance_right=0.0f);
|
||||
virtual void set_play_rate(PN_stdfloat play_rate=1.0f);
|
||||
|
||||
virtual float length() const;
|
||||
virtual PN_stdfloat length() const;
|
||||
|
||||
virtual AudioSound::SoundStatus status() const;
|
||||
|
||||
|
|
@ -54,12 +54,12 @@ public:
|
|||
|
||||
private:
|
||||
static void AILCALLBACK finish_callback(HSTREAM stream);
|
||||
void do_set_time(float time);
|
||||
void do_set_time(PN_stdfloat time);
|
||||
|
||||
Filename _path;
|
||||
HSTREAM _stream;
|
||||
S32 _original_playback_rate;
|
||||
mutable float _length;
|
||||
mutable PN_stdfloat _length;
|
||||
mutable bool _got_length;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -482,12 +482,12 @@ release_sound(OpenALAudioSound* audioSound) {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: OpenALAudioManager::set_volume(float volume)
|
||||
// Function: OpenALAudioManager::set_volume(PN_stdfloat volume)
|
||||
// Access: Public
|
||||
// Description:
|
||||
// Sets listener gain
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioManager::set_volume(float volume) {
|
||||
void OpenALAudioManager::set_volume(PN_stdfloat volume) {
|
||||
if (_volume!=volume) {
|
||||
_volume = volume;
|
||||
|
||||
|
|
@ -514,7 +514,7 @@ void OpenALAudioManager::set_volume(float volume) {
|
|||
// Description:
|
||||
// Gets listener gain
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioManager::
|
||||
PN_stdfloat OpenALAudioManager::
|
||||
get_volume() const {
|
||||
return _volume;
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ get_volume() const {
|
|||
// Description: set the overall play rate
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioManager::
|
||||
set_play_rate(float play_rate) {
|
||||
set_play_rate(PN_stdfloat play_rate) {
|
||||
if (_play_rate!=play_rate) {
|
||||
_play_rate = play_rate;
|
||||
// Tell our AudioSounds to adjust:
|
||||
|
|
@ -541,7 +541,7 @@ set_play_rate(float play_rate) {
|
|||
// Access: Public
|
||||
// Description: get the overall speed/pitch/play rate
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioManager::
|
||||
PN_stdfloat OpenALAudioManager::
|
||||
get_play_rate() const {
|
||||
return _play_rate;
|
||||
}
|
||||
|
|
@ -590,7 +590,7 @@ get_active() const {
|
|||
// I told you, so you can't say I didn't.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioManager::
|
||||
audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) {
|
||||
audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz, PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz, PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz) {
|
||||
_position[0] = px;
|
||||
_position[1] = pz;
|
||||
_position[2] = -py;
|
||||
|
|
@ -625,7 +625,7 @@ audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float v
|
|||
// Description: Get position of the "ear" that picks up 3d sounds
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioManager::
|
||||
audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) {
|
||||
audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz, PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz, PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz) {
|
||||
*px = _position[0];
|
||||
*py = -_position[2];
|
||||
*pz = _position[1];
|
||||
|
|
@ -654,7 +654,7 @@ audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, flo
|
|||
// OpenAL's default speed of sound is 343.3 m/s == 1126.3 ft/s
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioManager::
|
||||
audio_3d_set_distance_factor(float factor) {
|
||||
audio_3d_set_distance_factor(PN_stdfloat factor) {
|
||||
_distance_factor = factor;
|
||||
|
||||
make_current();
|
||||
|
|
@ -685,7 +685,7 @@ audio_3d_set_distance_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description: Sets units per foot
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioManager::
|
||||
PN_stdfloat OpenALAudioManager::
|
||||
audio_3d_get_distance_factor() const {
|
||||
return _distance_factor;
|
||||
}
|
||||
|
|
@ -697,7 +697,7 @@ audio_3d_get_distance_factor() const {
|
|||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioManager::
|
||||
audio_3d_set_doppler_factor(float factor) {
|
||||
audio_3d_set_doppler_factor(PN_stdfloat factor) {
|
||||
_doppler_factor = factor;
|
||||
|
||||
make_current();
|
||||
|
|
@ -712,7 +712,7 @@ audio_3d_set_doppler_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioManager::
|
||||
PN_stdfloat OpenALAudioManager::
|
||||
audio_3d_get_doppler_factor() const {
|
||||
return _doppler_factor;
|
||||
}
|
||||
|
|
@ -724,7 +724,7 @@ audio_3d_get_doppler_factor() const {
|
|||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioManager::
|
||||
audio_3d_set_drop_off_factor(float factor) {
|
||||
audio_3d_set_drop_off_factor(PN_stdfloat factor) {
|
||||
_drop_off_factor = factor;
|
||||
|
||||
AllSounds::iterator i=_all_sounds.begin();
|
||||
|
|
@ -738,7 +738,7 @@ audio_3d_set_drop_off_factor(float factor) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioManager::
|
||||
PN_stdfloat OpenALAudioManager::
|
||||
audio_3d_get_drop_off_factor() const {
|
||||
return _drop_off_factor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,11 +63,11 @@ class EXPCL_OPENAL_AUDIO OpenALAudioManager : public AudioManager {
|
|||
virtual void set_cache_limit(unsigned int count);
|
||||
virtual unsigned int get_cache_limit() const;
|
||||
|
||||
virtual void set_volume(float);
|
||||
virtual float get_volume() const;
|
||||
virtual void set_volume(PN_stdfloat);
|
||||
virtual PN_stdfloat get_volume() const;
|
||||
|
||||
void set_play_rate(float play_rate);
|
||||
float get_play_rate() const;
|
||||
void set_play_rate(PN_stdfloat play_rate);
|
||||
PN_stdfloat get_play_rate() const;
|
||||
|
||||
virtual void set_active(bool);
|
||||
virtual bool get_active() const;
|
||||
|
|
@ -78,34 +78,34 @@ class EXPCL_OPENAL_AUDIO OpenALAudioManager : public AudioManager {
|
|||
// fx, fy and fz are the respective components of a unit forward-vector
|
||||
// ux, uy and uz are the respective components of a unit up-vector
|
||||
// These changes will NOT be invoked until audio_3d_update() is called.
|
||||
virtual void audio_3d_set_listener_attributes(float px, float py, float pz,
|
||||
float vx, float xy, float xz,
|
||||
float fx, float fy, float fz,
|
||||
float ux, float uy, float uz);
|
||||
virtual void audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
|
||||
PN_stdfloat vx, PN_stdfloat xy, PN_stdfloat xz,
|
||||
PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz,
|
||||
PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz);
|
||||
|
||||
virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz,
|
||||
float *vx, float *vy, float *vz,
|
||||
float *fx, float *fy, float *fz,
|
||||
float *ux, float *uy, float *uz);
|
||||
virtual void audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz,
|
||||
PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz,
|
||||
PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz,
|
||||
PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz);
|
||||
|
||||
// Control the "relative distance factor" for 3D spacialized audio in units-per-foot. Default is 1.0
|
||||
// OpenAL has no distance factor but we use this as a scale
|
||||
// on the min/max distances of sounds to preserve FMOD compatibility.
|
||||
// Also, adjusts the speed of sound to compensate for unit difference.
|
||||
virtual void audio_3d_set_distance_factor(float factor);
|
||||
virtual float audio_3d_get_distance_factor() const;
|
||||
virtual void audio_3d_set_distance_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_distance_factor() const;
|
||||
|
||||
// Control the presence of the Doppler effect. Default is 1.0
|
||||
// Exaggerated Doppler, use >1.0
|
||||
// Diminshed Doppler, use <1.0
|
||||
virtual void audio_3d_set_doppler_factor(float factor);
|
||||
virtual float audio_3d_get_doppler_factor() const;
|
||||
virtual void audio_3d_set_doppler_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_doppler_factor() const;
|
||||
|
||||
// Exaggerate or diminish the effect of distance on sound. Default is 1.0
|
||||
// Faster drop off, use >1.0
|
||||
// Slower drop off, use <1.0
|
||||
virtual void audio_3d_set_drop_off_factor(float factor);
|
||||
virtual float audio_3d_get_drop_off_factor() const;
|
||||
virtual void audio_3d_set_drop_off_factor(PN_stdfloat factor);
|
||||
virtual PN_stdfloat audio_3d_get_drop_off_factor() const;
|
||||
|
||||
virtual void set_concurrent_sound_limit(unsigned int limit = 0);
|
||||
virtual unsigned int get_concurrent_sound_limit() const;
|
||||
|
|
@ -184,8 +184,8 @@ private:
|
|||
|
||||
// State:
|
||||
int _cache_limit;
|
||||
float _volume;
|
||||
float _play_rate;
|
||||
PN_stdfloat _volume;
|
||||
PN_stdfloat _play_rate;
|
||||
bool _active;
|
||||
bool _cleanup_required;
|
||||
// keep a count for startup and shutdown:
|
||||
|
|
@ -205,9 +205,9 @@ private:
|
|||
typedef pset<ALuint > SourceCache;
|
||||
static SourceCache *_al_sources;
|
||||
|
||||
float _distance_factor;
|
||||
float _doppler_factor;
|
||||
float _drop_off_factor;
|
||||
PN_stdfloat _distance_factor;
|
||||
PN_stdfloat _doppler_factor;
|
||||
PN_stdfloat _drop_off_factor;
|
||||
|
||||
ALfloat _position[3];
|
||||
ALfloat _velocity[3];
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ void OpenALAudioSound::
|
|||
play() {
|
||||
if (_manager == 0) return;
|
||||
|
||||
float px,py,pz,vx,vy,vz;
|
||||
PN_stdfloat px,py,pz,vx,vy,vz;
|
||||
|
||||
if (!_active) {
|
||||
_paused = true;
|
||||
|
|
@ -535,7 +535,7 @@ push_fresh_buffers() {
|
|||
// start from the specified offset.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_time(float time) {
|
||||
set_time(PN_stdfloat time) {
|
||||
_start_time = time;
|
||||
}
|
||||
|
||||
|
|
@ -544,7 +544,7 @@ set_time(float time) {
|
|||
// Access: public
|
||||
// Description: Gets the play position within the sound
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
get_time() const {
|
||||
if (_manager == 0) {
|
||||
return 0.0;
|
||||
|
|
@ -570,13 +570,13 @@ cache_time(double rtc) {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: OpenALAudioSound::set_volume(float vol)
|
||||
// Function: OpenALAudioSound::set_volume(PN_stdfloat vol)
|
||||
// Access: public
|
||||
// Description: 0.0 to 1.0 scale of volume converted to Fmod's
|
||||
// internal 0.0 to 255.0 scale.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_volume(float volume) {
|
||||
set_volume(PN_stdfloat volume) {
|
||||
_volume=volume;
|
||||
|
||||
if (_source) {
|
||||
|
|
@ -593,18 +593,18 @@ set_volume(float volume) {
|
|||
// Access: public
|
||||
// Description: Gets the current volume of a sound. 1 is Max. O is Min.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
get_volume() const {
|
||||
return _volume;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: OpenALAudioSound::set_balance(float bal)
|
||||
// Function: OpenALAudioSound::set_balance(PN_stdfloat bal)
|
||||
// Access: public
|
||||
// Description: -1.0 to 1.0 scale
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_balance(float balance_right) {
|
||||
set_balance(PN_stdfloat balance_right) {
|
||||
audio_debug("OpenALAudioSound::set_balance() not implemented");
|
||||
}
|
||||
|
||||
|
|
@ -615,21 +615,21 @@ set_balance(float balance_right) {
|
|||
// -1 should be all the way left.
|
||||
// 1 is all the way to the right.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
get_balance() const {
|
||||
audio_debug("OpenALAudioSound::get_balance() not implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: OpenALAudioSound::set_play_rate(float rate)
|
||||
// Function: OpenALAudioSound::set_play_rate(PN_stdfloat rate)
|
||||
// Access: public
|
||||
// Description: Sets the speed at which a sound plays back.
|
||||
// The rate is a multiple of the sound, normal playback speed.
|
||||
// IE 2 would play back 2 times fast, 3 would play 3 times, and so on.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_play_rate(float play_rate) {
|
||||
set_play_rate(PN_stdfloat play_rate) {
|
||||
_play_rate = play_rate;
|
||||
if (_source) {
|
||||
alSourcef(_source, AL_PITCH, play_rate);
|
||||
|
|
@ -641,7 +641,7 @@ set_play_rate(float play_rate) {
|
|||
// Access: public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
get_play_rate() const {
|
||||
return _play_rate;
|
||||
}
|
||||
|
|
@ -651,7 +651,7 @@ get_play_rate() const {
|
|||
// Access: public
|
||||
// Description: Get length
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
length() const {
|
||||
return _length;
|
||||
}
|
||||
|
|
@ -673,7 +673,7 @@ length() const {
|
|||
// coordinates from Panda to OpenAL and back.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) {
|
||||
set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz) {
|
||||
_location[0] = px;
|
||||
_location[1] = pz;
|
||||
_location[2] = -py;
|
||||
|
|
@ -700,7 +700,7 @@ set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) {
|
|||
// Currently unimplemented. Get the attributes of the attached object.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz) {
|
||||
get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz) {
|
||||
*px = _location[0];
|
||||
*py = -_location[2];
|
||||
*pz = _location[1];
|
||||
|
|
@ -717,7 +717,7 @@ get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *
|
|||
// affects the rate it falls off.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_3d_min_distance(float dist) {
|
||||
set_3d_min_distance(PN_stdfloat dist) {
|
||||
_min_dist = dist;
|
||||
|
||||
if (_source) {
|
||||
|
|
@ -734,7 +734,7 @@ set_3d_min_distance(float dist) {
|
|||
// Access: public
|
||||
// Description: Get the distance that this sound begins to fall off
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
get_3d_min_distance() const {
|
||||
return _min_dist;
|
||||
}
|
||||
|
|
@ -745,7 +745,7 @@ get_3d_min_distance() const {
|
|||
// Description: Set the distance that this sound stops falling off
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_3d_max_distance(float dist) {
|
||||
set_3d_max_distance(PN_stdfloat dist) {
|
||||
_max_dist = dist;
|
||||
|
||||
if (_source) {
|
||||
|
|
@ -762,7 +762,7 @@ set_3d_max_distance(float dist) {
|
|||
// Access: public
|
||||
// Description: Get the distance that this sound stops falling off
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
get_3d_max_distance() const {
|
||||
return _max_dist;
|
||||
}
|
||||
|
|
@ -774,7 +774,7 @@ get_3d_max_distance() const {
|
|||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void OpenALAudioSound::
|
||||
set_3d_drop_off_factor(float factor) {
|
||||
set_3d_drop_off_factor(PN_stdfloat factor) {
|
||||
_drop_off_factor = factor;
|
||||
|
||||
if (_source) {
|
||||
|
|
@ -792,7 +792,7 @@ set_3d_drop_off_factor(float factor) {
|
|||
// Description: Control the effect distance has on audability.
|
||||
// Defaults to 1.0
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float OpenALAudioSound::
|
||||
PN_stdfloat OpenALAudioSound::
|
||||
get_3d_drop_off_factor() const {
|
||||
return _drop_off_factor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,25 +61,25 @@ public:
|
|||
|
||||
// 0 = beginning; length() = end.
|
||||
// inits to 0.0.
|
||||
void set_time(float time=0.0);
|
||||
float get_time() const;
|
||||
void set_time(PN_stdfloat time=0.0);
|
||||
PN_stdfloat get_time() const;
|
||||
|
||||
// 0 = minimum; 1.0 = maximum.
|
||||
// inits to 1.0.
|
||||
void set_volume(float volume=1.0);
|
||||
float get_volume() const;
|
||||
void set_volume(PN_stdfloat volume=1.0);
|
||||
PN_stdfloat get_volume() const;
|
||||
|
||||
// -1.0 is hard left
|
||||
// 0.0 is centered
|
||||
// 1.0 is hard right
|
||||
// inits to 0.0.
|
||||
void set_balance(float balance_right=0.0);
|
||||
float get_balance() const;
|
||||
void set_balance(PN_stdfloat balance_right=0.0);
|
||||
PN_stdfloat get_balance() const;
|
||||
|
||||
// play_rate is any positive float value.
|
||||
// inits to 1.0.
|
||||
void set_play_rate(float play_rate=1.0f);
|
||||
float get_play_rate() const;
|
||||
void set_play_rate(PN_stdfloat play_rate=1.0f);
|
||||
PN_stdfloat get_play_rate() const;
|
||||
|
||||
// inits to manager's state.
|
||||
void set_active(bool active=true);
|
||||
|
|
@ -94,22 +94,22 @@ public:
|
|||
const string &get_name() const;
|
||||
|
||||
// return: playing time in seconds.
|
||||
float length() const;
|
||||
PN_stdfloat length() const;
|
||||
|
||||
// Controls the position of this sound's emitter.
|
||||
// pos is a pointer to an xyz triplet of the emitter's position.
|
||||
// vel is a pointer to an xyz triplet of the emitter's velocity.
|
||||
void set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz);
|
||||
void get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz);
|
||||
void set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz);
|
||||
void get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz);
|
||||
|
||||
void set_3d_min_distance(float dist);
|
||||
float get_3d_min_distance() const;
|
||||
void set_3d_min_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_min_distance() const;
|
||||
|
||||
void set_3d_max_distance(float dist);
|
||||
float get_3d_max_distance() const;
|
||||
void set_3d_max_distance(PN_stdfloat dist);
|
||||
PN_stdfloat get_3d_max_distance() const;
|
||||
|
||||
void set_3d_drop_off_factor(float factor);
|
||||
float get_3d_drop_off_factor() const;
|
||||
void set_3d_drop_off_factor(PN_stdfloat factor);
|
||||
PN_stdfloat get_3d_drop_off_factor() const;
|
||||
|
||||
AudioSound::SoundStatus status() const;
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ private:
|
|||
};
|
||||
|
||||
int _playing_loops;
|
||||
float _playing_rate;
|
||||
PN_stdfloat _playing_rate;
|
||||
|
||||
pdeque<QueuedBuffer> _stream_queued;
|
||||
int _loops_completed;
|
||||
|
|
@ -158,17 +158,17 @@ private:
|
|||
ALuint _source;
|
||||
PT(OpenALAudioManager) _manager;
|
||||
|
||||
float _volume; // 0..1.0
|
||||
float _balance; // -1..1
|
||||
float _play_rate; // 0..1.0
|
||||
PN_stdfloat _volume; // 0..1.0
|
||||
PN_stdfloat _balance; // -1..1
|
||||
PN_stdfloat _play_rate; // 0..1.0
|
||||
|
||||
bool _positional;
|
||||
ALfloat _location[3];
|
||||
ALfloat _velocity[3];
|
||||
|
||||
float _min_dist;
|
||||
float _max_dist;
|
||||
float _drop_off_factor;
|
||||
PN_stdfloat _min_dist;
|
||||
PN_stdfloat _max_dist;
|
||||
PN_stdfloat _drop_off_factor;
|
||||
|
||||
double _length;
|
||||
int _loop_count;
|
||||
|
|
@ -189,7 +189,7 @@ private:
|
|||
// during the AudioManager update. Updates need
|
||||
// to be atomic, because get_time can be called
|
||||
// in the cull thread.
|
||||
float _current_time;
|
||||
PN_stdfloat _current_time;
|
||||
|
||||
// This is the string that throw_event() will throw
|
||||
// when the sound finishes playing. It is not triggered
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "lpoint3.h"
|
||||
#include "geom.h"
|
||||
#include "pta_LVecBase3f.h"
|
||||
#include "pta_LVecBase3.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : BulletConvexHullShape
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include "bulletShape.h"
|
||||
|
||||
#include "geom.h"
|
||||
#include "pta_LVecBase3f.h"
|
||||
#include "pta_LVecBase3.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : BulletConvexPointCloudShape
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "boundingBox.h"
|
||||
#include "nurbsCurveEvaluator.h"
|
||||
#include "nurbsSurfaceEvaluator.h"
|
||||
#include "pta_LVecBase3f.h"
|
||||
#include "pta_LVecBase3.h"
|
||||
|
||||
class BulletSoftBodyConfig;
|
||||
class BulletSoftBodyMaterial;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "nodePath.h"
|
||||
#include "lpoint3.h"
|
||||
#include "geom.h"
|
||||
#include "pta_LVecBase3f.h"
|
||||
#include "pta_LVecBase3.h"
|
||||
#include "pta_int.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AnimBundle::
|
||||
AnimBundle(const string &name, float fps, int num_frames) : AnimGroup(name) {
|
||||
AnimBundle(const string &name, PN_stdfloat fps, int num_frames) : AnimGroup(name) {
|
||||
_fps = fps;
|
||||
_num_frames = num_frames;
|
||||
_root = this;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ make_copy(AnimGroup *parent) const {
|
|||
void AnimBundle::
|
||||
write_datagram(BamWriter *manager, Datagram &me) {
|
||||
AnimGroup::write_datagram(manager, me);
|
||||
me.add_float32(_fps);
|
||||
me.add_stdfloat(_fps);
|
||||
me.add_uint16(_num_frames);
|
||||
}
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
void AnimBundle::
|
||||
fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
AnimGroup::fillin(scan, manager);
|
||||
_fps = scan.get_float32();
|
||||
_fps = scan.get_stdfloat();
|
||||
_num_frames = scan.get_uint16();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ protected:
|
|||
AnimBundle(AnimGroup *parent, const AnimBundle ©);
|
||||
|
||||
PUBLISHED:
|
||||
INLINE AnimBundle(const string &name, float fps, int num_frames);
|
||||
INLINE AnimBundle(const string &name, PN_stdfloat fps, int num_frames);
|
||||
|
||||
PT(AnimBundle) copy_bundle() const;
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ protected:
|
|||
virtual AnimGroup *make_copy(AnimGroup *parent) const;
|
||||
|
||||
private:
|
||||
float _fps;
|
||||
PN_stdfloat _fps;
|
||||
int _num_frames;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ get_value_no_scale_shear(int frame, ValueType &value) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
template<class SwitchType>
|
||||
void AnimChannel<SwitchType>::
|
||||
get_scale(int, LVecBase3f &scale) {
|
||||
get_scale(int, LVecBase3 &scale) {
|
||||
nassertv(false);
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ get_scale(int, LVecBase3f &scale) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
template<class SwitchType>
|
||||
void AnimChannel<SwitchType>::
|
||||
get_hpr(int, LVecBase3f &hpr) {
|
||||
get_hpr(int, LVecBase3 &hpr) {
|
||||
nassertv(false);
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ get_hpr(int, LVecBase3f &hpr) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
template<class SwitchType>
|
||||
void AnimChannel<SwitchType>::
|
||||
get_quat(int, LQuaternionf &quat) {
|
||||
get_quat(int, LQuaternion &quat) {
|
||||
nassertv(false);
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ get_quat(int, LQuaternionf &quat) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
template<class SwitchType>
|
||||
void AnimChannel<SwitchType>::
|
||||
get_pos(int, LVecBase3f &pos) {
|
||||
get_pos(int, LVecBase3 &pos) {
|
||||
nassertv(false);
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ get_pos(int, LVecBase3f &pos) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
template<class SwitchType>
|
||||
void AnimChannel<SwitchType>::
|
||||
get_shear(int, LVecBase3f &shear) {
|
||||
get_shear(int, LVecBase3 &shear) {
|
||||
nassertv(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@
|
|||
////////////////////////////////////////////////////////////////////
|
||||
void ACMatrixSwitchType::
|
||||
output_value(ostream &out, const ACMatrixSwitchType::ValueType &value) {
|
||||
LVecBase3f scale, shear, hpr, translate;
|
||||
LVecBase3 scale, shear, hpr, translate;
|
||||
if (decompose_matrix(value, scale, shear, hpr, translate)) {
|
||||
if (!scale.almost_equal(LVecBase3f(1.0f, 1.0f, 1.0f))) {
|
||||
if (!scale.almost_equal(LVecBase3(1.0f, 1.0f, 1.0f))) {
|
||||
if (IS_NEARLY_EQUAL(scale[0], scale[1]) &&
|
||||
IS_NEARLY_EQUAL(scale[1], scale[2])) {
|
||||
out << " scale " << scale[0];
|
||||
|
|
@ -39,15 +39,15 @@ output_value(ostream &out, const ACMatrixSwitchType::ValueType &value) {
|
|||
out << " scale " << scale;
|
||||
}
|
||||
}
|
||||
if (!shear.almost_equal(LVecBase3f(0.0f, 0.0f, 0.0f))) {
|
||||
if (!shear.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
|
||||
out << " shear " << shear;
|
||||
}
|
||||
|
||||
if (!hpr.almost_equal(LVecBase3f(0.0f, 0.0f, 0.0f))) {
|
||||
if (!hpr.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
|
||||
out << " hpr " << hpr;
|
||||
}
|
||||
|
||||
if (!translate.almost_equal(LVecBase3f(0.0f, 0.0f, 0.0f))) {
|
||||
if (!translate.almost_equal(LVecBase3(0.0f, 0.0f, 0.0f))) {
|
||||
out << " trans " << translate;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,11 +46,11 @@ PUBLISHED:
|
|||
|
||||
// These transform-component methods only have meaning for matrix types.
|
||||
virtual void get_value_no_scale_shear(int frame, ValueType &value);
|
||||
virtual void get_scale(int frame, LVecBase3f &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3f &hpr);
|
||||
virtual void get_quat(int frame, LQuaternionf &quat);
|
||||
virtual void get_pos(int frame, LVecBase3f &pos);
|
||||
virtual void get_shear(int frame, LVecBase3f &shear);
|
||||
virtual void get_scale(int frame, LVecBase3 &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3 &hpr);
|
||||
virtual void get_quat(int frame, LQuaternion &quat);
|
||||
virtual void get_pos(int frame, LVecBase3 &pos);
|
||||
virtual void get_shear(int frame, LVecBase3 &shear);
|
||||
|
||||
virtual TypeHandle get_value_type() const;
|
||||
|
||||
|
|
@ -80,10 +80,10 @@ private:
|
|||
|
||||
class EXPCL_PANDA_CHAN ACMatrixSwitchType {
|
||||
public:
|
||||
typedef LMatrix4f ValueType;
|
||||
typedef LMatrix4 ValueType;
|
||||
static const char *get_channel_type_name() { return "AnimChannelMatrix"; }
|
||||
static const char *get_fixed_channel_type_name() { return "AnimChannelFixed<LMatrix4f>"; }
|
||||
static const char *get_part_type_name() { return "MovingPart<LMatrix4f>"; }
|
||||
static const char *get_fixed_channel_type_name() { return "AnimChannelFixed<LMatrix4>"; }
|
||||
static const char *get_part_type_name() { return "MovingPart<LMatrix4>"; }
|
||||
static void output_value(ostream &out, const ValueType &value);
|
||||
|
||||
static void write_datagram(Datagram &dest, ValueType& me)
|
||||
|
|
@ -102,20 +102,20 @@ typedef AnimChannel<ACMatrixSwitchType> AnimChannelMatrix;
|
|||
|
||||
class EXPCL_PANDA_CHAN ACScalarSwitchType {
|
||||
public:
|
||||
typedef float ValueType;
|
||||
typedef PN_stdfloat ValueType;
|
||||
static const char *get_channel_type_name() { return "AnimChannelScalar"; }
|
||||
static const char *get_fixed_channel_type_name() { return "AnimChannelScalarFixed"; }
|
||||
static const char *get_part_type_name() { return "MovingPart<float>"; }
|
||||
static const char *get_part_type_name() { return "MovingPart<PN_stdfloat>"; }
|
||||
static void output_value(ostream &out, ValueType value) {
|
||||
out << value;
|
||||
}
|
||||
static void write_datagram(Datagram &dest, ValueType& me)
|
||||
{
|
||||
dest.add_float32(me);
|
||||
dest.add_stdfloat(me);
|
||||
}
|
||||
static void read_datagram(DatagramIterator &source, ValueType& me)
|
||||
{
|
||||
me = source.get_float32();
|
||||
me = source.get_stdfloat();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ has_changed(int, double, int, double) {
|
|||
// Description: Gets the value of the channel at the indicated frame.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
get_value(int, LMatrix4f &mat) {
|
||||
get_value(int, LMatrix4 &mat) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
_value = _value_node->get_transform();
|
||||
}
|
||||
|
|
@ -103,12 +103,12 @@ get_value(int, LMatrix4f &mat) {
|
|||
// without any scale or shear information.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
get_value_no_scale_shear(int, LMatrix4f &mat) {
|
||||
get_value_no_scale_shear(int, LMatrix4 &mat) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
_value = _value_node->get_transform();
|
||||
}
|
||||
if (_value->has_scale() || _value->has_shear()) {
|
||||
compose_matrix(mat, LVecBase3f(1.0f, 1.0f, 1.0f),
|
||||
compose_matrix(mat, LVecBase3(1.0f, 1.0f, 1.0f),
|
||||
_value->get_hpr(), _value->get_pos());
|
||||
} else {
|
||||
mat = _value->get_mat();
|
||||
|
|
@ -121,7 +121,7 @@ get_value_no_scale_shear(int, LMatrix4f &mat) {
|
|||
// Description: Gets the scale value at the indicated frame.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
get_scale(int, LVecBase3f &scale) {
|
||||
get_scale(int, LVecBase3 &scale) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
_value = _value_node->get_transform();
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ get_scale(int, LVecBase3f &scale) {
|
|||
// sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
get_hpr(int, LVecBase3f &hpr) {
|
||||
get_hpr(int, LVecBase3 &hpr) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
_value = _value_node->get_transform();
|
||||
}
|
||||
|
|
@ -151,7 +151,7 @@ get_hpr(int, LVecBase3f &hpr) {
|
|||
// this only makes sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
get_quat(int, LQuaternionf &quat) {
|
||||
get_quat(int, LQuaternion &quat) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
_value = _value_node->get_transform();
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@ get_quat(int, LQuaternionf &quat) {
|
|||
// only makes sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
get_pos(int, LVecBase3f &pos) {
|
||||
get_pos(int, LVecBase3 &pos) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
_value = _value_node->get_transform();
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ get_pos(int, LVecBase3f &pos) {
|
|||
// sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
get_shear(int, LVecBase3f &shear) {
|
||||
get_shear(int, LVecBase3 &shear) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
_value = _value_node->get_transform();
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ get_shear(int, LVecBase3f &shear) {
|
|||
// Description: Explicitly sets the matrix value.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixDynamic::
|
||||
set_value(const LMatrix4f &value) {
|
||||
set_value(const LMatrix4 &value) {
|
||||
_value = TransformState::make_mat(value);
|
||||
_value_node.clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,17 +44,17 @@ public:
|
|||
|
||||
virtual bool has_changed(int last_frame, double last_frac,
|
||||
int this_frame, double this_frac);
|
||||
virtual void get_value(int frame, LMatrix4f &mat);
|
||||
virtual void get_value(int frame, LMatrix4 &mat);
|
||||
|
||||
virtual void get_value_no_scale_shear(int frame, LMatrix4f &value);
|
||||
virtual void get_scale(int frame, LVecBase3f &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3f &hpr);
|
||||
virtual void get_quat(int frame, LQuaternionf &quat);
|
||||
virtual void get_pos(int frame, LVecBase3f &pos);
|
||||
virtual void get_shear(int frame, LVecBase3f &shear);
|
||||
virtual void get_value_no_scale_shear(int frame, LMatrix4 &value);
|
||||
virtual void get_scale(int frame, LVecBase3 &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3 &hpr);
|
||||
virtual void get_quat(int frame, LQuaternion &quat);
|
||||
virtual void get_pos(int frame, LVecBase3 &pos);
|
||||
virtual void get_shear(int frame, LVecBase3 &shear);
|
||||
|
||||
PUBLISHED:
|
||||
void set_value(const LMatrix4f &value);
|
||||
void set_value(const LMatrix4 &value);
|
||||
void set_value(const TransformState *value);
|
||||
void set_value_node(PandaNode *node);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ AnimChannelMatrixFixed(AnimGroup *parent, const AnimChannelMatrixFixed ©) :
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
AnimChannelMatrixFixed::
|
||||
AnimChannelMatrixFixed(const string &name, const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale) :
|
||||
AnimChannelMatrixFixed(const string &name, const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale) :
|
||||
AnimChannel<ACMatrixSwitchType>(name),
|
||||
_pos(pos), _hpr(hpr), _scale(scale)
|
||||
{
|
||||
|
|
@ -63,8 +63,8 @@ has_changed(int, double, int, double) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixFixed::
|
||||
get_value(int, LMatrix4f &value) {
|
||||
compose_matrix(value, _scale, LVecBase3f::zero(), _hpr, _pos);
|
||||
get_value(int, LMatrix4 &value) {
|
||||
compose_matrix(value, _scale, LVecBase3::zero(), _hpr, _pos);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -74,8 +74,8 @@ get_value(int, LMatrix4f &value) {
|
|||
// without any scale or shear information.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixFixed::
|
||||
get_value_no_scale_shear(int, LMatrix4f &mat) {
|
||||
compose_matrix(mat, LVecBase3f(1.0f, 1.0f, 1.0f), LVecBase3f::zero(),
|
||||
get_value_no_scale_shear(int, LMatrix4 &mat) {
|
||||
compose_matrix(mat, LVecBase3(1.0f, 1.0f, 1.0f), LVecBase3::zero(),
|
||||
_hpr, _pos);
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ get_value_no_scale_shear(int, LMatrix4f &mat) {
|
|||
// Description: Gets the scale value at the indicated frame.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixFixed::
|
||||
get_scale(int, LVecBase3f &scale) {
|
||||
get_scale(int, LVecBase3 &scale) {
|
||||
scale = _scale;
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ get_scale(int, LVecBase3f &scale) {
|
|||
// sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixFixed::
|
||||
get_hpr(int, LVecBase3f &hpr) {
|
||||
get_hpr(int, LVecBase3 &hpr) {
|
||||
hpr = _hpr;
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ get_hpr(int, LVecBase3f &hpr) {
|
|||
// this only makes sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixFixed::
|
||||
get_quat(int, LQuaternionf &quat) {
|
||||
get_quat(int, LQuaternion &quat) {
|
||||
quat.set_hpr(_hpr);
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ get_quat(int, LQuaternionf &quat) {
|
|||
// only makes sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixFixed::
|
||||
get_pos(int, LVecBase3f &pos) {
|
||||
get_pos(int, LVecBase3 &pos) {
|
||||
pos = _pos;
|
||||
}
|
||||
|
||||
|
|
@ -133,8 +133,8 @@ get_pos(int, LVecBase3f &pos) {
|
|||
// sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixFixed::
|
||||
get_shear(int, LVecBase3f &shear) {
|
||||
shear = LVecBase3f::zero();
|
||||
get_shear(int, LVecBase3 &shear) {
|
||||
shear = LVecBase3::zero();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -184,7 +184,7 @@ write_datagram(BamWriter *manager, Datagram &dg) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
TypedWritable *AnimChannelMatrixFixed::
|
||||
make_from_bam(const FactoryParams ¶ms) {
|
||||
AnimChannelMatrixFixed *chan = new AnimChannelMatrixFixed("", LVecBase3f::zero(), LVecBase3f::zero(), LVecBase3f::zero());
|
||||
AnimChannelMatrixFixed *chan = new AnimChannelMatrixFixed("", LVecBase3::zero(), LVecBase3::zero(), LVecBase3::zero());
|
||||
DatagramIterator scan;
|
||||
BamReader *manager;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,22 +32,22 @@ protected:
|
|||
AnimChannelMatrixFixed(AnimGroup *parent, const AnimChannelMatrixFixed ©);
|
||||
|
||||
public:
|
||||
AnimChannelMatrixFixed(const string &name, const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale);
|
||||
AnimChannelMatrixFixed(const string &name, const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
|
||||
|
||||
virtual bool has_changed(int last_frame, double last_frac,
|
||||
int this_frame, double this_frac);
|
||||
virtual void get_value(int frame, LMatrix4f &value);
|
||||
virtual void get_value_no_scale_shear(int frame, LMatrix4f &value);
|
||||
virtual void get_scale(int frame, LVecBase3f &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3f &hpr);
|
||||
virtual void get_quat(int frame, LQuaternionf &quat);
|
||||
virtual void get_pos(int frame, LVecBase3f &pos);
|
||||
virtual void get_shear(int frame, LVecBase3f &shear);
|
||||
virtual void get_value(int frame, LMatrix4 &value);
|
||||
virtual void get_value_no_scale_shear(int frame, LMatrix4 &value);
|
||||
virtual void get_scale(int frame, LVecBase3 &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3 &hpr);
|
||||
virtual void get_quat(int frame, LQuaternion &quat);
|
||||
virtual void get_pos(int frame, LVecBase3 &pos);
|
||||
virtual void get_shear(int frame, LVecBase3 &shear);
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
|
||||
private:
|
||||
LVecBase3f _pos, _hpr, _scale;
|
||||
LVecBase3 _pos, _hpr, _scale;
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ is_valid_id(char table_id) {
|
|||
// Description: Returns a pointer to the indicated subtable's data,
|
||||
// if it exists, or NULL if it does not.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CPTA_float AnimChannelMatrixXfmTable::
|
||||
INLINE CPTA_stdfloat AnimChannelMatrixXfmTable::
|
||||
get_table(char table_id) const {
|
||||
int table_index = get_table_index(table_id);
|
||||
if (table_index < 0) {
|
||||
return CPTA_float(get_class_type());
|
||||
return CPTA_stdfloat(get_class_type());
|
||||
}
|
||||
return _tables[table_index];
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ has_table(char table_id) const {
|
|||
if (table_index < 0) {
|
||||
return false;
|
||||
}
|
||||
return !(_tables[table_index] == (const float *)NULL);
|
||||
return !(_tables[table_index] == (const PN_stdfloat *)NULL);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -88,7 +88,7 @@ get_table_id(int table_index) {
|
|||
// Description: Returns the default value the indicated table is
|
||||
// expected to have in the absence of any data.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float AnimChannelMatrixXfmTable::
|
||||
INLINE PN_stdfloat AnimChannelMatrixXfmTable::
|
||||
get_default_value(int table_index) {
|
||||
nassertr(table_index >= 0 && table_index < num_matrix_components, 0.0);
|
||||
return matrix_component_defaults[table_index];
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ TypeHandle AnimChannelMatrixXfmTable::_type_handle;
|
|||
AnimChannelMatrixXfmTable::
|
||||
AnimChannelMatrixXfmTable() {
|
||||
for (int i = 0; i < num_matrix_components; i++) {
|
||||
_tables[i] = CPTA_float(get_class_type());
|
||||
_tables[i] = CPTA_stdfloat(get_class_type());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ AnimChannelMatrixXfmTable(AnimGroup *parent, const string &name)
|
|||
: AnimChannelMatrix(parent, name)
|
||||
{
|
||||
for (int i = 0; i < num_matrix_components; i++) {
|
||||
_tables[i] = CPTA_float(get_class_type());
|
||||
_tables[i] = CPTA_stdfloat(get_class_type());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -125,8 +125,8 @@ has_changed(int last_frame, double last_frac,
|
|||
// Description: Gets the value of the channel at the indicated frame.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
get_value(int frame, LMatrix4f &mat) {
|
||||
float components[num_matrix_components];
|
||||
get_value(int frame, LMatrix4 &mat) {
|
||||
PN_stdfloat components[num_matrix_components];
|
||||
|
||||
for (int i = 0; i < num_matrix_components; i++) {
|
||||
if (_tables[i].empty()) {
|
||||
|
|
@ -146,8 +146,8 @@ get_value(int frame, LMatrix4f &mat) {
|
|||
// without any scale or shear information.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
get_value_no_scale_shear(int frame, LMatrix4f &mat) {
|
||||
float components[num_matrix_components];
|
||||
get_value_no_scale_shear(int frame, LMatrix4 &mat) {
|
||||
PN_stdfloat components[num_matrix_components];
|
||||
components[0] = 1.0f;
|
||||
components[1] = 1.0f;
|
||||
components[2] = 1.0f;
|
||||
|
|
@ -172,7 +172,7 @@ get_value_no_scale_shear(int frame, LMatrix4f &mat) {
|
|||
// Description: Gets the scale value at the indicated frame.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
get_scale(int frame, LVecBase3f &scale) {
|
||||
get_scale(int frame, LVecBase3 &scale) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (_tables[i].empty()) {
|
||||
scale[i] = 1.0f;
|
||||
|
|
@ -190,7 +190,7 @@ get_scale(int frame, LVecBase3f &scale) {
|
|||
// sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
get_hpr(int frame, LVecBase3f &hpr) {
|
||||
get_hpr(int frame, LVecBase3 &hpr) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (_tables[i + 6].empty()) {
|
||||
hpr[i] = 0.0f;
|
||||
|
|
@ -208,8 +208,8 @@ get_hpr(int frame, LVecBase3f &hpr) {
|
|||
// this only makes sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
get_quat(int frame, LQuaternionf &quat) {
|
||||
LVecBase3f hpr;
|
||||
get_quat(int frame, LQuaternion &quat) {
|
||||
LVecBase3 hpr;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (_tables[i + 6].empty()) {
|
||||
hpr[i] = 0.0f;
|
||||
|
|
@ -229,7 +229,7 @@ get_quat(int frame, LQuaternionf &quat) {
|
|||
// only makes sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
get_pos(int frame, LVecBase3f &pos) {
|
||||
get_pos(int frame, LVecBase3 &pos) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (_tables[i + 9].empty()) {
|
||||
pos[i] = 0.0f;
|
||||
|
|
@ -247,7 +247,7 @@ get_pos(int frame, LVecBase3f &pos) {
|
|||
// sense for a matrix-type channel.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
get_shear(int frame, LVecBase3f &shear) {
|
||||
get_shear(int frame, LVecBase3 &shear) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (_tables[i + 3].empty()) {
|
||||
shear[i] = 0.0f;
|
||||
|
|
@ -267,7 +267,7 @@ get_shear(int frame, LVecBase3f &shear) {
|
|||
// one, or get_num_frames() frames.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelMatrixXfmTable::
|
||||
set_table(char table_id, const CPTA_float &table) {
|
||||
set_table(char table_id, const CPTA_stdfloat &table) {
|
||||
int num_frames = _root->get_num_frames();
|
||||
|
||||
if (table.size() > 1 && (int)table.size() < num_frames) {
|
||||
|
|
@ -295,7 +295,7 @@ set_table(char table_id, const CPTA_float &table) {
|
|||
void AnimChannelMatrixXfmTable::
|
||||
clear_all_tables() {
|
||||
for (int i = 0; i < num_matrix_components; i++) {
|
||||
_tables[i] = CPTA_float(get_class_type());
|
||||
_tables[i] = CPTA_stdfloat(get_class_type());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -388,7 +388,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
for (int i = 0; i < num_matrix_components; i++) {
|
||||
me.add_uint16(_tables[i].size());
|
||||
for(int j = 0; j < (int)_tables[i].size(); j++) {
|
||||
me.add_float32(_tables[i][j]);
|
||||
me.add_stdfloat(_tables[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -407,16 +407,16 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
|
||||
// Now, write out the joint angles. For these we need to build up
|
||||
// a HPR array.
|
||||
pvector<LVecBase3f> hprs;
|
||||
pvector<LVecBase3> hprs;
|
||||
int hprs_length = max(max(_tables[6].size(), _tables[7].size()), _tables[8].size());
|
||||
hprs.reserve(hprs_length);
|
||||
for (i = 0; i < hprs_length; i++) {
|
||||
float h = _tables[6].empty() ? 0.0f : _tables[6][i % _tables[6].size()];
|
||||
float p = _tables[7].empty() ? 0.0f : _tables[7][i % _tables[7].size()];
|
||||
float r = _tables[8].empty() ? 0.0f : _tables[8][i % _tables[8].size()];
|
||||
hprs.push_back(LVecBase3f(h, p, r));
|
||||
PN_stdfloat h = _tables[6].empty() ? 0.0f : _tables[6][i % _tables[6].size()];
|
||||
PN_stdfloat p = _tables[7].empty() ? 0.0f : _tables[7][i % _tables[7].size()];
|
||||
PN_stdfloat r = _tables[8].empty() ? 0.0f : _tables[8][i % _tables[8].size()];
|
||||
hprs.push_back(LVecBase3(h, p, r));
|
||||
}
|
||||
const LVecBase3f *hprs_array = NULL;
|
||||
const LVecBase3 *hprs_array = NULL;
|
||||
if (hprs_length != 0) {
|
||||
hprs_array = &hprs[0];
|
||||
}
|
||||
|
|
@ -450,9 +450,9 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
|
||||
for (int i = 0; i < num_matrix_components; i++) {
|
||||
int size = scan.get_uint16();
|
||||
PTA_float ind_table(get_class_type());
|
||||
PTA_stdfloat ind_table(get_class_type());
|
||||
for (int j = 0; j < size; j++) {
|
||||
ind_table.push_back(scan.get_float32());
|
||||
ind_table.push_back(scan.get_stdfloat());
|
||||
}
|
||||
_tables[i] = ind_table;
|
||||
}
|
||||
|
|
@ -462,7 +462,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
size_t num_hprs = max(max(_tables[6].size(), _tables[7].size()),
|
||||
_tables[8].size());
|
||||
|
||||
LVecBase3f default_hpr(0.0, 0.0, 0.0);
|
||||
LVecBase3 default_hpr(0.0, 0.0, 0.0);
|
||||
if (!_tables[6].empty()) {
|
||||
default_hpr[0] = _tables[6][0];
|
||||
}
|
||||
|
|
@ -473,20 +473,20 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
default_hpr[2] = _tables[8][0];
|
||||
}
|
||||
|
||||
PTA_float h_table = PTA_float::empty_array(num_hprs, get_class_type());
|
||||
PTA_float p_table = PTA_float::empty_array(num_hprs, get_class_type());
|
||||
PTA_float r_table = PTA_float::empty_array(num_hprs, get_class_type());
|
||||
PTA_stdfloat h_table = PTA_stdfloat::empty_array(num_hprs, get_class_type());
|
||||
PTA_stdfloat p_table = PTA_stdfloat::empty_array(num_hprs, get_class_type());
|
||||
PTA_stdfloat r_table = PTA_stdfloat::empty_array(num_hprs, get_class_type());
|
||||
|
||||
for (size_t hi = 0; hi < num_hprs; hi++) {
|
||||
float h = (hi < _tables[6].size() ? _tables[6][hi] : default_hpr[0]);
|
||||
float p = (hi < _tables[7].size() ? _tables[7][hi] : default_hpr[1]);
|
||||
float r = (hi < _tables[8].size() ? _tables[8][hi] : default_hpr[2]);
|
||||
PN_stdfloat h = (hi < _tables[6].size() ? _tables[6][hi] : default_hpr[0]);
|
||||
PN_stdfloat p = (hi < _tables[7].size() ? _tables[7][hi] : default_hpr[1]);
|
||||
PN_stdfloat r = (hi < _tables[8].size() ? _tables[8][hi] : default_hpr[2]);
|
||||
|
||||
LVecBase3f hpr;
|
||||
LVecBase3 hpr;
|
||||
if (temp_hpr_fix) {
|
||||
hpr = old_to_new_hpr(LVecBase3f(h, p, r));
|
||||
hpr = old_to_new_hpr(LVecBase3(h, p, r));
|
||||
} else {
|
||||
hpr = new_to_old_hpr(LVecBase3f(h, p, r));
|
||||
hpr = new_to_old_hpr(LVecBase3(h, p, r));
|
||||
}
|
||||
h_table[hi] = hpr[0];
|
||||
p_table[hi] = hpr[1];
|
||||
|
|
@ -512,29 +512,29 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
int i;
|
||||
// First, read in the scales and shears.
|
||||
for (i = 0; i < 6; i++) {
|
||||
PTA_float ind_table = PTA_float::empty_array(0, get_class_type());
|
||||
PTA_stdfloat ind_table = PTA_stdfloat::empty_array(0, get_class_type());
|
||||
compressor.read_reals(scan, ind_table.v());
|
||||
_tables[i] = ind_table;
|
||||
}
|
||||
|
||||
// Read in the HPR array and store it back in the joint angles.
|
||||
pvector<LVecBase3f> hprs;
|
||||
pvector<LVecBase3> hprs;
|
||||
compressor.read_hprs(scan, hprs, new_hpr);
|
||||
PTA_float h_table = PTA_float::empty_array(hprs.size(), get_class_type());
|
||||
PTA_float p_table = PTA_float::empty_array(hprs.size(), get_class_type());
|
||||
PTA_float r_table = PTA_float::empty_array(hprs.size(), get_class_type());
|
||||
PTA_stdfloat h_table = PTA_stdfloat::empty_array(hprs.size(), get_class_type());
|
||||
PTA_stdfloat p_table = PTA_stdfloat::empty_array(hprs.size(), get_class_type());
|
||||
PTA_stdfloat r_table = PTA_stdfloat::empty_array(hprs.size(), get_class_type());
|
||||
|
||||
for (i = 0; i < (int)hprs.size(); i++) {
|
||||
if (!new_hpr && temp_hpr_fix) {
|
||||
// Convert the old HPR form to the new HPR form.
|
||||
LVecBase3f hpr = old_to_new_hpr(hprs[i]);
|
||||
LVecBase3 hpr = old_to_new_hpr(hprs[i]);
|
||||
h_table[i] = hpr[0];
|
||||
p_table[i] = hpr[1];
|
||||
r_table[i] = hpr[2];
|
||||
|
||||
} else if (new_hpr && !temp_hpr_fix) {
|
||||
// Convert the new HPR form to the old HPR form.
|
||||
LVecBase3f hpr = new_to_old_hpr(hprs[i]);
|
||||
LVecBase3 hpr = new_to_old_hpr(hprs[i]);
|
||||
h_table[i] = hpr[0];
|
||||
p_table[i] = hpr[1];
|
||||
r_table[i] = hpr[2];
|
||||
|
|
@ -552,7 +552,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
|
||||
// Now read in the translations.
|
||||
for (i = 9; i < num_matrix_components; i++) {
|
||||
PTA_float ind_table = PTA_float::empty_array(0, get_class_type());
|
||||
PTA_stdfloat ind_table = PTA_stdfloat::empty_array(0, get_class_type());
|
||||
compressor.read_reals(scan, ind_table.v());
|
||||
_tables[i] = ind_table;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "animChannel.h"
|
||||
|
||||
#include "pointerToArray.h"
|
||||
#include "pta_float.h"
|
||||
#include "pta_stdfloat.h"
|
||||
#include "compose_matrix.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -43,20 +43,20 @@ PUBLISHED:
|
|||
public:
|
||||
virtual bool has_changed(int last_frame, double last_frac,
|
||||
int this_frame, double this_frac);
|
||||
virtual void get_value(int frame, LMatrix4f &mat);
|
||||
virtual void get_value(int frame, LMatrix4 &mat);
|
||||
|
||||
virtual void get_value_no_scale_shear(int frame, LMatrix4f &value);
|
||||
virtual void get_scale(int frame, LVecBase3f &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3f &hpr);
|
||||
virtual void get_quat(int frame, LQuaternionf &quat);
|
||||
virtual void get_pos(int frame, LVecBase3f &pos);
|
||||
virtual void get_shear(int frame, LVecBase3f &shear);
|
||||
virtual void get_value_no_scale_shear(int frame, LMatrix4 &value);
|
||||
virtual void get_scale(int frame, LVecBase3 &scale);
|
||||
virtual void get_hpr(int frame, LVecBase3 &hpr);
|
||||
virtual void get_quat(int frame, LQuaternion &quat);
|
||||
virtual void get_pos(int frame, LVecBase3 &pos);
|
||||
virtual void get_shear(int frame, LVecBase3 &shear);
|
||||
|
||||
PUBLISHED:
|
||||
static INLINE bool is_valid_id(char table_id);
|
||||
|
||||
void set_table(char table_id, const CPTA_float &table);
|
||||
INLINE CPTA_float get_table(char table_id) const;
|
||||
void set_table(char table_id, const CPTA_stdfloat &table);
|
||||
INLINE CPTA_stdfloat get_table(char table_id) const;
|
||||
|
||||
void clear_all_tables();
|
||||
INLINE bool has_table(char table_id) const;
|
||||
|
|
@ -70,9 +70,9 @@ protected:
|
|||
|
||||
INLINE static char get_table_id(int table_index);
|
||||
static int get_table_index(char table_id);
|
||||
INLINE static float get_default_value(int table_index);
|
||||
INLINE static PN_stdfloat get_default_value(int table_index);
|
||||
|
||||
CPTA_float _tables[num_matrix_components];
|
||||
CPTA_stdfloat _tables[num_matrix_components];
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ has_changed(int, double, int, double) {
|
|||
// Description: Gets the value of the channel at the indicated frame.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelScalarDynamic::
|
||||
get_value(int, float &value) {
|
||||
get_value(int, PN_stdfloat &value) {
|
||||
if (_value_node != (PandaNode *)NULL) {
|
||||
value = _value->get_pos()[0];
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ get_value(int, float &value) {
|
|||
// Description: Explicitly sets the value.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelScalarDynamic::
|
||||
set_value(float value) {
|
||||
set_value(PN_stdfloat value) {
|
||||
_float_value = value;
|
||||
_value_node.clear();
|
||||
_value_changed = true;
|
||||
|
|
@ -127,7 +127,7 @@ set_value(float value) {
|
|||
void AnimChannelScalarDynamic::
|
||||
set_value_node(PandaNode *value_node) {
|
||||
if (_value_node == (PandaNode *)NULL) {
|
||||
_last_value = TransformState::make_pos(LVecBase3f(_float_value, 0.0f, 0.0f));
|
||||
_last_value = TransformState::make_pos(LVecBase3(_float_value, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
_value_node = value_node;
|
||||
|
|
@ -162,7 +162,7 @@ write_datagram(BamWriter *manager, Datagram &dg) {
|
|||
AnimChannelScalar::write_datagram(manager, dg);
|
||||
manager->write_pointer(dg, _value_node);
|
||||
manager->write_pointer(dg, _value);
|
||||
dg.add_float32(_float_value);
|
||||
dg.add_stdfloat(_float_value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -199,7 +199,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
manager->read_pointer(scan);
|
||||
manager->read_pointer(scan);
|
||||
|
||||
_float_value = scan.get_float32();
|
||||
_float_value = scan.get_stdfloat();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@ public:
|
|||
|
||||
virtual bool has_changed(int last_frame, double last_frac,
|
||||
int this_frame, double this_frac);
|
||||
virtual void get_value(int frame, float &value);
|
||||
virtual void get_value(int frame, PN_stdfloat &value);
|
||||
|
||||
PUBLISHED:
|
||||
void set_value(float value);
|
||||
void set_value(PN_stdfloat value);
|
||||
void set_value_node(PandaNode *node);
|
||||
|
||||
protected:
|
||||
|
|
@ -64,7 +64,7 @@ private:
|
|||
// This is used only if we are using the explicit set_value()
|
||||
// interface.
|
||||
bool _value_changed;
|
||||
float _float_value;
|
||||
PN_stdfloat _float_value;
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// Description: Returns a pointer to the table's data,
|
||||
// if it exists, or NULL if it does not.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CPTA_float AnimChannelScalarTable::
|
||||
INLINE CPTA_stdfloat AnimChannelScalarTable::
|
||||
get_table() const {
|
||||
return _table;
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ get_table() const {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AnimChannelScalarTable::
|
||||
has_table() const {
|
||||
return _table != (const float *)NULL;
|
||||
return _table != (const PN_stdfloat *)NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ has_changed(int last_frame, double last_frac,
|
|||
// Description: Gets the value of the channel at the indicated frame.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelScalarTable::
|
||||
get_value(int frame, float &value) {
|
||||
get_value(int frame, PN_stdfloat &value) {
|
||||
if (_table.empty()) {
|
||||
value = 0.0f;
|
||||
} else {
|
||||
|
|
@ -114,7 +114,7 @@ get_value(int frame, float &value) {
|
|||
// Description: Assigns the data table.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimChannelScalarTable::
|
||||
set_table(const CPTA_float &table) {
|
||||
set_table(const CPTA_stdfloat &table) {
|
||||
int num_frames = _root->get_num_frames();
|
||||
|
||||
if (table.size() > 1 && (int)table.size() < num_frames) {
|
||||
|
|
@ -181,7 +181,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
// Write out everything the old way, as floats.
|
||||
me.add_uint16(_table.size());
|
||||
for(int i = 0; i < (int)_table.size(); i++) {
|
||||
me.add_float32(_table[i]);
|
||||
me.add_stdfloat(_table[i]);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -193,7 +193,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
// only to the nearest 1000th for this purpose, because floats
|
||||
// aren't very good at being precisely equal to each other.
|
||||
static const int max_values = 16;
|
||||
static const float scale = 1000.0f;
|
||||
static const PN_stdfloat scale = 1000.0f;
|
||||
|
||||
pmap<int, int> index;
|
||||
int i;
|
||||
|
|
@ -213,17 +213,17 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||
if (index_length > 0) {
|
||||
// We need to write the index in order by its index number; for
|
||||
// this, we need to invert the index.
|
||||
vector_float reverse_index(index_length);
|
||||
vector_stdfloat reverse_index(index_length);
|
||||
pmap<int, int>::iterator mi;
|
||||
for (mi = index.begin(); mi != index.end(); ++mi) {
|
||||
float f = (float)(*mi).first / scale;
|
||||
PN_stdfloat f = (PN_stdfloat)(*mi).first / scale;
|
||||
int i = (*mi).second;
|
||||
nassertv(i >= 0 && i < (int)reverse_index.size());
|
||||
reverse_index[i] = f;
|
||||
}
|
||||
|
||||
for (i = 0; i < index_length; i++) {
|
||||
me.add_float32(reverse_index[i]);
|
||||
me.add_stdfloat(reverse_index[i]);
|
||||
}
|
||||
|
||||
// Now write out the actual channels. We write these two at a
|
||||
|
|
@ -284,13 +284,13 @@ fillin(DatagramIterator& scan, BamReader* manager) {
|
|||
|
||||
bool wrote_compressed = scan.get_bool();
|
||||
|
||||
PTA_float temp_table = PTA_float::empty_array(0, get_class_type());
|
||||
PTA_stdfloat temp_table = PTA_stdfloat::empty_array(0, get_class_type());
|
||||
|
||||
if (!wrote_compressed) {
|
||||
// Regular floats.
|
||||
int size = scan.get_uint16();
|
||||
for(int i = 0; i < size; i++) {
|
||||
temp_table.push_back(scan.get_float32());
|
||||
temp_table.push_back(scan.get_stdfloat());
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -301,11 +301,11 @@ fillin(DatagramIterator& scan, BamReader* manager) {
|
|||
if (index_length < 0xff) {
|
||||
// Discrete. Read in the index.
|
||||
if (index_length > 0) {
|
||||
float *index = (float *)alloca(index_length * sizeof(float));
|
||||
PN_stdfloat *index = (PN_stdfloat *)alloca(index_length * sizeof(PN_stdfloat));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < index_length; i++) {
|
||||
index[i] = scan.get_float32();
|
||||
index[i] = scan.get_stdfloat();
|
||||
}
|
||||
|
||||
// Now read in the channel values.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "animChannel.h"
|
||||
|
||||
#include "pointerToArray.h"
|
||||
#include "pta_float.h"
|
||||
#include "pta_stdfloat.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : AnimChannelScalarTable
|
||||
|
|
@ -38,11 +38,11 @@ public:
|
|||
|
||||
virtual bool has_changed(int last_frame, double last_frac,
|
||||
int this_frame, double this_frac);
|
||||
virtual void get_value(int frame, float &value);
|
||||
virtual void get_value(int frame, PN_stdfloat &value);
|
||||
|
||||
PUBLISHED:
|
||||
void set_table(const CPTA_float &table);
|
||||
INLINE CPTA_float get_table() const;
|
||||
void set_table(const CPTA_stdfloat &table);
|
||||
INLINE CPTA_stdfloat get_table() const;
|
||||
|
||||
INLINE bool has_table() const;
|
||||
INLINE void clear_table();
|
||||
|
|
@ -54,7 +54,7 @@ protected:
|
|||
virtual AnimGroup *make_copy(AnimGroup *parent) const;
|
||||
|
||||
protected:
|
||||
CPTA_float _table;
|
||||
CPTA_stdfloat _table;
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ get_basename(int n) const {
|
|||
// Description: Returns the frame rate stored for the nth animation
|
||||
// record.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float AnimPreloadTable::
|
||||
INLINE PN_stdfloat AnimPreloadTable::
|
||||
get_base_frame_rate(int n) const {
|
||||
nassertr(n >= 0 && n < (int)_anims.size(), 0.0f);
|
||||
consider_sort();
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ remove_anim(int n) {
|
|||
// numbers.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimPreloadTable::
|
||||
add_anim(const string &basename, float base_frame_rate, int num_frames) {
|
||||
add_anim(const string &basename, PN_stdfloat base_frame_rate, int num_frames) {
|
||||
AnimRecord record;
|
||||
record._basename = basename;
|
||||
record._base_frame_rate = base_frame_rate;
|
||||
|
|
@ -198,7 +198,7 @@ write_datagram(BamWriter *manager, Datagram &dg) {
|
|||
for (ai = _anims.begin(); ai != _anims.end(); ++ai) {
|
||||
const AnimRecord &record = (*ai);
|
||||
dg.add_string(record._basename);
|
||||
dg.add_float32(record._base_frame_rate);
|
||||
dg.add_stdfloat(record._base_frame_rate);
|
||||
dg.add_int32(record._num_frames);
|
||||
}
|
||||
}
|
||||
|
|
@ -234,7 +234,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
for (int i = 0; i < num_anims; ++i) {
|
||||
AnimRecord record;
|
||||
record._basename = scan.get_string();
|
||||
record._base_frame_rate = scan.get_float32();
|
||||
record._base_frame_rate = scan.get_stdfloat();
|
||||
record._num_frames = scan.get_int32();
|
||||
_anims.push_back(record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public:
|
|||
INLINE bool operator < (const AnimRecord &other) const;
|
||||
|
||||
string _basename;
|
||||
float _base_frame_rate;
|
||||
PN_stdfloat _base_frame_rate;
|
||||
int _num_frames;
|
||||
};
|
||||
|
||||
|
|
@ -59,12 +59,12 @@ PUBLISHED:
|
|||
int find_anim(const string &basename) const;
|
||||
|
||||
INLINE string get_basename(int n) const;
|
||||
INLINE float get_base_frame_rate(int n) const;
|
||||
INLINE PN_stdfloat get_base_frame_rate(int n) const;
|
||||
INLINE int get_num_frames(int n) const;
|
||||
|
||||
void clear_anims();
|
||||
void remove_anim(int n);
|
||||
void add_anim(const string &basename, float base_frame_rate, int num_frames);
|
||||
void add_anim(const string &basename, PN_stdfloat base_frame_rate, int num_frames);
|
||||
void add_anims_from(const AnimPreloadTable *other);
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ ConfigureFn(config_chan) {
|
|||
// be initialized. We have to do it explicitly here since template
|
||||
// statics don't necessarily resolve very well across dynamic
|
||||
// libraries.
|
||||
LMatrix4f::init_type();
|
||||
LMatrix4::init_type();
|
||||
|
||||
//Registration of writeable object's creation
|
||||
//functions with BamReader's factory
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ MovingPartMatrix(const MovingPartMatrix ©) :
|
|||
////////////////////////////////////////////////////////////////////
|
||||
INLINE MovingPartMatrix::
|
||||
MovingPartMatrix(PartGroup *parent, const string &name,
|
||||
const LMatrix4f &default_value)
|
||||
const LMatrix4 &default_value)
|
||||
: MovingPart<ACMatrixSwitchType>(parent, name, default_value) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ MovingPartMatrix::
|
|||
////////////////////////////////////////////////////////////////////
|
||||
AnimChannelBase *MovingPartMatrix::
|
||||
make_default_channel() const {
|
||||
LVecBase3f pos, hpr, scale, shear;
|
||||
LVecBase3 pos, hpr, scale, shear;
|
||||
decompose_matrix(_default_value, pos, hpr, scale, shear);
|
||||
return new AnimChannelMatrixFixed(get_name(), pos, hpr, scale);
|
||||
}
|
||||
|
|
@ -93,13 +93,13 @@ get_blend_value(const PartBundle *root) {
|
|||
case PartBundle::BT_linear:
|
||||
{
|
||||
// An ordinary, linear blend.
|
||||
LMatrix4f net_value = LMatrix4f::zeros_mat();
|
||||
float net_effect = 0.0f;
|
||||
LMatrix4 net_value = LMatrix4::zeros_mat();
|
||||
PN_stdfloat net_effect = 0.0f;
|
||||
|
||||
PartBundle::ChannelBlend::const_iterator cbi;
|
||||
for (cbi = cdata->_blend.begin(); cbi != cdata->_blend.end(); ++cbi) {
|
||||
AnimControl *control = (*cbi).first;
|
||||
float effect = (*cbi).second;
|
||||
PN_stdfloat effect = (*cbi).second;
|
||||
nassertv(effect != 0.0f);
|
||||
|
||||
int channel_index = control->get_channel_index();
|
||||
|
|
@ -114,7 +114,7 @@ get_blend_value(const PartBundle *root) {
|
|||
net_value += v * effect;
|
||||
} else {
|
||||
// Blend between successive frames.
|
||||
float frac = (float)control->get_frac();
|
||||
PN_stdfloat frac = (PN_stdfloat)control->get_frac();
|
||||
net_value += v * (effect * (1.0f - frac));
|
||||
|
||||
channel->get_value(control->get_next_frame(), v);
|
||||
|
|
@ -142,15 +142,15 @@ get_blend_value(const PartBundle *root) {
|
|||
// artificially-introduced scales, and then reapply the
|
||||
// scales and shears.
|
||||
|
||||
LMatrix4f net_value = LMatrix4f::zeros_mat();
|
||||
LVecBase3f scale(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3f shear(0.0f, 0.0f, 0.0f);
|
||||
float net_effect = 0.0f;
|
||||
LMatrix4 net_value = LMatrix4::zeros_mat();
|
||||
LVecBase3 scale(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3 shear(0.0f, 0.0f, 0.0f);
|
||||
PN_stdfloat net_effect = 0.0f;
|
||||
|
||||
PartBundle::ChannelBlend::const_iterator cbi;
|
||||
for (cbi = cdata->_blend.begin(); cbi != cdata->_blend.end(); ++cbi) {
|
||||
AnimControl *control = (*cbi).first;
|
||||
float effect = (*cbi).second;
|
||||
PN_stdfloat effect = (*cbi).second;
|
||||
nassertv(effect != 0.0f);
|
||||
|
||||
ChannelType *channel = NULL;
|
||||
|
|
@ -161,7 +161,7 @@ get_blend_value(const PartBundle *root) {
|
|||
if (channel != (ChannelType *)NULL) {
|
||||
int frame = control->get_frame();
|
||||
ValueType v;
|
||||
LVecBase3f iscale, ishear;
|
||||
LVecBase3 iscale, ishear;
|
||||
channel->get_value_no_scale_shear(frame, v);
|
||||
channel->get_scale(frame, iscale);
|
||||
channel->get_shear(frame, ishear);
|
||||
|
|
@ -173,8 +173,8 @@ get_blend_value(const PartBundle *root) {
|
|||
shear += ishear * effect;
|
||||
} else {
|
||||
// Blend between successive frames.
|
||||
float frac = (float)control->get_frac();
|
||||
float e0 = effect * (1.0f - frac);
|
||||
PN_stdfloat frac = (PN_stdfloat)control->get_frac();
|
||||
PN_stdfloat e0 = effect * (1.0f - frac);
|
||||
net_value += v * e0;
|
||||
scale += iscale * e0;
|
||||
shear += ishear * e0;
|
||||
|
|
@ -183,7 +183,7 @@ get_blend_value(const PartBundle *root) {
|
|||
channel->get_value_no_scale_shear(next_frame, v);
|
||||
channel->get_scale(next_frame, iscale);
|
||||
channel->get_shear(next_frame, ishear);
|
||||
float e1 = effect * frac;
|
||||
PN_stdfloat e1 = effect * frac;
|
||||
net_value += v * e1;
|
||||
scale += iscale * e1;
|
||||
shear += ishear * e1;
|
||||
|
|
@ -204,7 +204,7 @@ get_blend_value(const PartBundle *root) {
|
|||
|
||||
// Now rebuild the matrix with the correct scale values.
|
||||
|
||||
LVector3f false_scale, false_shear, hpr, translate;
|
||||
LVector3 false_scale, false_shear, hpr, translate;
|
||||
decompose_matrix(net_value, false_scale, false_shear, hpr, translate);
|
||||
compose_matrix(_value, scale, shear, hpr, translate);
|
||||
}
|
||||
|
|
@ -214,16 +214,16 @@ get_blend_value(const PartBundle *root) {
|
|||
case PartBundle::BT_componentwise:
|
||||
{
|
||||
// Componentwise linear, including componentwise H, P, and R.
|
||||
LVecBase3f scale(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3f hpr(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3f pos(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3f shear(0.0f, 0.0f, 0.0f);
|
||||
float net_effect = 0.0f;
|
||||
LVecBase3 scale(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3 hpr(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3 pos(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3 shear(0.0f, 0.0f, 0.0f);
|
||||
PN_stdfloat net_effect = 0.0f;
|
||||
|
||||
PartBundle::ChannelBlend::const_iterator cbi;
|
||||
for (cbi = cdata->_blend.begin(); cbi != cdata->_blend.end(); ++cbi) {
|
||||
AnimControl *control = (*cbi).first;
|
||||
float effect = (*cbi).second;
|
||||
PN_stdfloat effect = (*cbi).second;
|
||||
nassertv(effect != 0.0f);
|
||||
|
||||
ChannelType *channel = NULL;
|
||||
|
|
@ -233,7 +233,7 @@ get_blend_value(const PartBundle *root) {
|
|||
}
|
||||
if (channel != (ChannelType *)NULL) {
|
||||
int frame = control->get_frame();
|
||||
LVecBase3f iscale, ihpr, ipos, ishear;
|
||||
LVecBase3 iscale, ihpr, ipos, ishear;
|
||||
channel->get_scale(frame, iscale);
|
||||
channel->get_hpr(frame, ihpr);
|
||||
channel->get_pos(frame, ipos);
|
||||
|
|
@ -247,8 +247,8 @@ get_blend_value(const PartBundle *root) {
|
|||
shear += ishear * effect;
|
||||
} else {
|
||||
// Blend between successive frames.
|
||||
float frac = (float)control->get_frac();
|
||||
float e0 = effect * (1.0f - frac);
|
||||
PN_stdfloat frac = (PN_stdfloat)control->get_frac();
|
||||
PN_stdfloat e0 = effect * (1.0f - frac);
|
||||
|
||||
scale += iscale * e0;
|
||||
hpr += ihpr * e0;
|
||||
|
|
@ -260,7 +260,7 @@ get_blend_value(const PartBundle *root) {
|
|||
channel->get_hpr(next_frame, ihpr);
|
||||
channel->get_pos(next_frame, ipos);
|
||||
channel->get_shear(next_frame, ishear);
|
||||
float e1 = effect * frac;
|
||||
PN_stdfloat e1 = effect * frac;
|
||||
|
||||
scale += iscale * e1;
|
||||
hpr += ihpr * e1;
|
||||
|
|
@ -291,16 +291,16 @@ get_blend_value(const PartBundle *root) {
|
|||
{
|
||||
// Componentwise linear, except for rotation, which is a
|
||||
// quaternion.
|
||||
LVecBase3f scale(0.0f, 0.0f, 0.0f);
|
||||
LQuaternionf quat(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
LVecBase3f pos(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3f shear(0.0f, 0.0f, 0.0f);
|
||||
float net_effect = 0.0f;
|
||||
LVecBase3 scale(0.0f, 0.0f, 0.0f);
|
||||
LQuaternion quat(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
LVecBase3 pos(0.0f, 0.0f, 0.0f);
|
||||
LVecBase3 shear(0.0f, 0.0f, 0.0f);
|
||||
PN_stdfloat net_effect = 0.0f;
|
||||
|
||||
PartBundle::ChannelBlend::const_iterator cbi;
|
||||
for (cbi = cdata->_blend.begin(); cbi != cdata->_blend.end(); ++cbi) {
|
||||
AnimControl *control = (*cbi).first;
|
||||
float effect = (*cbi).second;
|
||||
PN_stdfloat effect = (*cbi).second;
|
||||
nassertv(effect != 0.0f);
|
||||
|
||||
ChannelType *channel = NULL;
|
||||
|
|
@ -310,8 +310,8 @@ get_blend_value(const PartBundle *root) {
|
|||
}
|
||||
if (channel != (ChannelType *)NULL) {
|
||||
int frame = control->get_frame();
|
||||
LVecBase3f iscale, ipos, ishear;
|
||||
LQuaternionf iquat;
|
||||
LVecBase3 iscale, ipos, ishear;
|
||||
LQuaternion iquat;
|
||||
channel->get_scale(frame, iscale);
|
||||
channel->get_quat(frame, iquat);
|
||||
channel->get_pos(frame, ipos);
|
||||
|
|
@ -326,8 +326,8 @@ get_blend_value(const PartBundle *root) {
|
|||
|
||||
} else {
|
||||
// Blend between successive frames.
|
||||
float frac = (float)control->get_frac();
|
||||
float e0 = effect * (1.0f - frac);
|
||||
PN_stdfloat frac = (PN_stdfloat)control->get_frac();
|
||||
PN_stdfloat e0 = effect * (1.0f - frac);
|
||||
|
||||
scale += iscale * e0;
|
||||
quat += iquat * e0;
|
||||
|
|
@ -339,7 +339,7 @@ get_blend_value(const PartBundle *root) {
|
|||
channel->get_quat(next_frame, iquat);
|
||||
channel->get_pos(next_frame, ipos);
|
||||
channel->get_shear(next_frame, ishear);
|
||||
float e1 = effect * frac;
|
||||
PN_stdfloat e1 = effect * frac;
|
||||
|
||||
scale += iscale * e1;
|
||||
quat += iquat * e1;
|
||||
|
|
@ -365,7 +365,7 @@ get_blend_value(const PartBundle *root) {
|
|||
// assuming all of the input quaternions were already
|
||||
// normalized.
|
||||
|
||||
_value = LMatrix4f::scale_shear_mat(scale, shear) * quat;
|
||||
_value = LMatrix4::scale_shear_mat(scale, shear) * quat;
|
||||
_value.set_row(3, pos);
|
||||
}
|
||||
}
|
||||
|
|
@ -384,7 +384,7 @@ get_blend_value(const PartBundle *root) {
|
|||
// PartBundle::freeze_joint().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool MovingPartMatrix::
|
||||
apply_freeze_matrix(const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale) {
|
||||
apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale) {
|
||||
_forced_channel = new AnimChannelMatrixFixed(get_name(), pos, hpr, scale);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,13 +35,13 @@ protected:
|
|||
|
||||
public:
|
||||
INLINE MovingPartMatrix(PartGroup *parent, const string &name,
|
||||
const LMatrix4f &default_value);
|
||||
const LMatrix4 &default_value);
|
||||
virtual ~MovingPartMatrix();
|
||||
|
||||
virtual AnimChannelBase *make_default_channel() const;
|
||||
virtual void get_blend_value(const PartBundle *root);
|
||||
|
||||
virtual bool apply_freeze_matrix(const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale);
|
||||
virtual bool apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
|
||||
virtual bool apply_control(PandaNode *node);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ MovingPartScalar(const MovingPartScalar ©) :
|
|||
////////////////////////////////////////////////////////////////////
|
||||
INLINE MovingPartScalar::
|
||||
MovingPartScalar(PartGroup *parent, const string &name,
|
||||
const float &default_value)
|
||||
const PN_stdfloat &default_value)
|
||||
: MovingPart<ACScalarSwitchType>(parent, name, default_value) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,12 +71,12 @@ get_blend_value(const PartBundle *root) {
|
|||
} else {
|
||||
// A blend of two or more values.
|
||||
_value = 0.0f;
|
||||
float net = 0.0f;
|
||||
PN_stdfloat net = 0.0f;
|
||||
|
||||
PartBundle::ChannelBlend::const_iterator cbi;
|
||||
for (cbi = cdata->_blend.begin(); cbi != cdata->_blend.end(); ++cbi) {
|
||||
AnimControl *control = (*cbi).first;
|
||||
float effect = (*cbi).second;
|
||||
PN_stdfloat effect = (*cbi).second;
|
||||
nassertv(effect != 0.0f);
|
||||
|
||||
ChannelType *channel = NULL;
|
||||
|
|
@ -93,7 +93,7 @@ get_blend_value(const PartBundle *root) {
|
|||
_value += v * effect;
|
||||
} else {
|
||||
// Blend between successive frames.
|
||||
float frac = (float)control->get_frac();
|
||||
PN_stdfloat frac = (PN_stdfloat)control->get_frac();
|
||||
_value += v * (effect * (1.0f - frac));
|
||||
|
||||
channel->get_value(control->get_next_frame(), v);
|
||||
|
|
@ -124,7 +124,7 @@ get_blend_value(const PartBundle *root) {
|
|||
// PartBundle::freeze_joint().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool MovingPartScalar::
|
||||
apply_freeze_scalar(float value) {
|
||||
apply_freeze_scalar(PN_stdfloat value) {
|
||||
_forced_channel = new AnimChannelFixed<ACScalarSwitchType>(get_name(), value);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ protected:
|
|||
|
||||
public:
|
||||
INLINE MovingPartScalar(PartGroup *parent, const string &name,
|
||||
const float &default_value = 0);
|
||||
const PN_stdfloat &default_value = 0);
|
||||
virtual ~MovingPartScalar();
|
||||
|
||||
virtual void get_blend_value(const PartBundle *root);
|
||||
|
||||
virtual bool apply_freeze_scalar(float value);
|
||||
virtual bool apply_freeze_scalar(PN_stdfloat value);
|
||||
virtual bool apply_control(PandaNode *node);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ get_frame_blend_flag() const {
|
|||
// applied at the root of the animated hierarchy.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void PartBundle::
|
||||
set_root_xform(const LMatrix4f &root_xform) {
|
||||
set_root_xform(const LMatrix4 &root_xform) {
|
||||
nassertv(Thread::get_current_pipeline_stage() == 0);
|
||||
CDWriter cdata(_cycler);
|
||||
cdata->_root_xform = root_xform;
|
||||
|
|
@ -168,7 +168,7 @@ set_root_xform(const LMatrix4f &root_xform) {
|
|||
// animated hierarchy.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void PartBundle::
|
||||
xform(const LMatrix4f &mat) {
|
||||
xform(const LMatrix4 &mat) {
|
||||
nassertv(Thread::get_current_pipeline_stage() == 0);
|
||||
CDWriter cdata(_cycler);
|
||||
cdata->_root_xform = cdata->_root_xform * mat;
|
||||
|
|
@ -182,7 +182,7 @@ xform(const LMatrix4f &mat) {
|
|||
// Description: Returns the transform matrix which is implicitly
|
||||
// applied at the root of the animated hierarchy.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const LMatrix4f &PartBundle::
|
||||
INLINE const LMatrix4 &PartBundle::
|
||||
get_root_xform() const {
|
||||
CDReader cdata(_cycler);
|
||||
return cdata->_root_xform;
|
||||
|
|
@ -229,7 +229,7 @@ get_node(int n) const {
|
|||
// animation.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PartBundle::
|
||||
set_control_effect(AnimControl *control, float effect) {
|
||||
set_control_effect(AnimControl *control, PN_stdfloat effect) {
|
||||
nassertv(Thread::get_current_pipeline_stage() == 0);
|
||||
|
||||
CDWriter cdata(_cycler);
|
||||
|
|
@ -243,7 +243,7 @@ set_control_effect(AnimControl *control, float effect) {
|
|||
// by the indicated AnimControl and its associated
|
||||
// animation. See set_control_effect().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE float PartBundle::
|
||||
INLINE PN_stdfloat PartBundle::
|
||||
get_control_effect(AnimControl *control) const {
|
||||
CDReader cdata(_cycler);
|
||||
return do_get_control_effect(control, cdata);
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ load_bind_anim(Loader *loader, const Filename &filename,
|
|||
|
||||
// The animation is present in the table, so we can perform an
|
||||
// asynchronous load-and-bind.
|
||||
float frame_rate = anim_preload->get_base_frame_rate(anim_index);
|
||||
PN_stdfloat frame_rate = anim_preload->get_base_frame_rate(anim_index);
|
||||
int num_frames = anim_preload->get_num_frames(anim_index);
|
||||
PT(AnimControl) control =
|
||||
new AnimControl(basename, this, frame_rate, num_frames);
|
||||
|
|
@ -394,7 +394,7 @@ wait_pending() {
|
|||
cbi != cdata->_blend.end();
|
||||
++cbi) {
|
||||
AnimControl *control = (*cbi).first;
|
||||
float effect = (*cbi).second;
|
||||
PN_stdfloat effect = (*cbi).second;
|
||||
if (effect != 0.0f) {
|
||||
control->wait_pending();
|
||||
}
|
||||
|
|
@ -441,7 +441,7 @@ freeze_joint(const string &joint_name, const TransformState *transform) {
|
|||
// or does not exist.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PartBundle::
|
||||
freeze_joint(const string &joint_name, const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale) {
|
||||
freeze_joint(const string &joint_name, const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale) {
|
||||
PartGroup *child = find_child(joint_name);
|
||||
if (child == (PartGroup *)NULL) {
|
||||
return false;
|
||||
|
|
@ -467,7 +467,7 @@ freeze_joint(const string &joint_name, const LVecBase3f &pos, const LVecBase3f &
|
|||
// or does not exist.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PartBundle::
|
||||
freeze_joint(const string &joint_name, float value) {
|
||||
freeze_joint(const string &joint_name, PN_stdfloat value) {
|
||||
PartGroup *child = find_child(joint_name);
|
||||
if (child == (PartGroup *)NULL) {
|
||||
return false;
|
||||
|
|
@ -709,7 +709,7 @@ remove_node(PartBundleNode *node) {
|
|||
// Description: The private implementation of set_control_effect().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PartBundle::
|
||||
do_set_control_effect(AnimControl *control, float effect, CData *cdata) {
|
||||
do_set_control_effect(AnimControl *control, PN_stdfloat effect, CData *cdata) {
|
||||
nassertv(control->get_part() == this);
|
||||
|
||||
if (effect == 0.0f) {
|
||||
|
|
@ -744,7 +744,7 @@ do_set_control_effect(AnimControl *control, float effect, CData *cdata) {
|
|||
// Access: Private
|
||||
// Description: The private implementation of get_control_effect().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float PartBundle::
|
||||
PN_stdfloat PartBundle::
|
||||
do_get_control_effect(AnimControl *control, const CData *cdata) const {
|
||||
nassertr(control->get_part() == this, 0.0f);
|
||||
|
||||
|
|
@ -920,7 +920,7 @@ CData() {
|
|||
_blend_type = anim_blend_type;
|
||||
_anim_blend_flag = false;
|
||||
_frame_blend_flag = interpolate_frames;
|
||||
_root_xform = LMatrix4f::ident_mat();
|
||||
_root_xform = LMatrix4::ident_mat();
|
||||
_last_control_set = NULL;
|
||||
_net_blend = 0.0f;
|
||||
_anim_changed = false;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
// This is passed down through the MovingParts during the
|
||||
// do_update() call to specify the channels that are in effect.
|
||||
typedef pmap<AnimControl *, float> ChannelBlend;
|
||||
typedef pmap<AnimControl *, PN_stdfloat> ChannelBlend;
|
||||
|
||||
protected:
|
||||
// The copy constructor is protected; use make_copy() or copy_subgraph().
|
||||
|
|
@ -109,9 +109,9 @@ PUBLISHED:
|
|||
INLINE void set_frame_blend_flag(bool frame_blend_flag);
|
||||
INLINE bool get_frame_blend_flag() const;
|
||||
|
||||
INLINE void set_root_xform(const LMatrix4f &root_xform);
|
||||
INLINE void xform(const LMatrix4f &mat);
|
||||
INLINE const LMatrix4f &get_root_xform() const;
|
||||
INLINE void set_root_xform(const LMatrix4 &root_xform);
|
||||
INLINE void xform(const LMatrix4 &mat);
|
||||
INLINE const LMatrix4 &get_root_xform() const;
|
||||
PT(PartBundle) apply_transform(const TransformState *transform);
|
||||
|
||||
INLINE int get_num_nodes() const;
|
||||
|
|
@ -119,8 +119,8 @@ PUBLISHED:
|
|||
MAKE_SEQ(get_nodes, get_num_nodes, get_node);
|
||||
|
||||
void clear_control_effects();
|
||||
INLINE void set_control_effect(AnimControl *control, float effect);
|
||||
INLINE float get_control_effect(AnimControl *control) const;
|
||||
INLINE void set_control_effect(AnimControl *control, PN_stdfloat effect);
|
||||
INLINE PN_stdfloat get_control_effect(AnimControl *control) const;
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
virtual void write(ostream &out, int indent_level) const;
|
||||
|
|
@ -136,8 +136,8 @@ PUBLISHED:
|
|||
void wait_pending();
|
||||
|
||||
bool freeze_joint(const string &joint_name, const TransformState *transform);
|
||||
bool freeze_joint(const string &joint_name, const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale);
|
||||
bool freeze_joint(const string &joint_name, float value);
|
||||
bool freeze_joint(const string &joint_name, const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
|
||||
bool freeze_joint(const string &joint_name, PN_stdfloat value);
|
||||
bool control_joint(const string &joint_name, PandaNode *node);
|
||||
bool release_joint(const string &joint_name);
|
||||
|
||||
|
|
@ -161,8 +161,8 @@ protected:
|
|||
private:
|
||||
class CData;
|
||||
|
||||
void do_set_control_effect(AnimControl *control, float effect, CData *cdata);
|
||||
float do_get_control_effect(AnimControl *control, const CData *cdata) const;
|
||||
void do_set_control_effect(AnimControl *control, PN_stdfloat effect, CData *cdata);
|
||||
PN_stdfloat do_get_control_effect(AnimControl *control, const CData *cdata) const;
|
||||
void recompute_net_blend(CData *cdata);
|
||||
void clear_and_stop_intersecting(AnimControl *control, CData *cdata);
|
||||
|
||||
|
|
@ -192,10 +192,10 @@ private:
|
|||
BlendType _blend_type;
|
||||
bool _anim_blend_flag;
|
||||
bool _frame_blend_flag;
|
||||
LMatrix4f _root_xform;
|
||||
LMatrix4 _root_xform;
|
||||
AnimControl *_last_control_set;
|
||||
ChannelBlend _blend;
|
||||
float _net_blend;
|
||||
PN_stdfloat _net_blend;
|
||||
bool _anim_changed;
|
||||
double _last_update;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -72,12 +72,12 @@ apply_attribs_to_vertices(const AccumulatedAttribs &attribs, int attrib_types,
|
|||
// most kinds of PandaNodes, this does nothing.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PartBundleNode::
|
||||
xform(const LMatrix4f &mat) {
|
||||
xform(const LMatrix4 &mat) {
|
||||
// With plain xform(), we can't attempt to share bundles across
|
||||
// different nodes. Better to use apply_attribs_to_vertices(),
|
||||
// instead.
|
||||
|
||||
if (mat.almost_equal(LMatrix4f::ident_mat())) {
|
||||
if (mat.almost_equal(LMatrix4::ident_mat())) {
|
||||
// Don't bother.
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
virtual void apply_attribs_to_vertices(const AccumulatedAttribs &attribs,
|
||||
int attrib_types,
|
||||
GeomTransformer &transformer);
|
||||
virtual void xform(const LMatrix4f &mat);
|
||||
virtual void xform(const LMatrix4 &mat);
|
||||
|
||||
PUBLISHED:
|
||||
INLINE int get_num_bundles() const;
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ apply_freeze(const TransformState *transform) {
|
|||
// directly.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PartGroup::
|
||||
apply_freeze_matrix(const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale) {
|
||||
apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ apply_freeze_matrix(const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase
|
|||
// directly.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PartGroup::
|
||||
apply_freeze_scalar(float value) {
|
||||
apply_freeze_scalar(PN_stdfloat value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ do_update(PartBundle *root, const CycleData *root_cdata, PartGroup *,
|
|||
// joint.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PartGroup::
|
||||
do_xform(const LMatrix4f &mat, const LMatrix4f &inv_mat) {
|
||||
do_xform(const LMatrix4 &mat, const LMatrix4 &inv_mat) {
|
||||
Children::const_iterator ci;
|
||||
|
||||
for (ci = _children.begin(); ci != _children.end(); ++ci) {
|
||||
|
|
@ -733,7 +733,7 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
|||
if (manager->get_file_minor_ver() == 11) {
|
||||
// Skip over the old freeze-joint information, no longer stored here
|
||||
scan.get_bool();
|
||||
LMatrix4f mat;
|
||||
LMatrix4 mat;
|
||||
mat.read_datagram(scan);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ PUBLISHED:
|
|||
void sort_descendants();
|
||||
|
||||
bool apply_freeze(const TransformState *transform);
|
||||
virtual bool apply_freeze_matrix(const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale);
|
||||
virtual bool apply_freeze_scalar(float value);
|
||||
virtual bool apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale);
|
||||
virtual bool apply_freeze_scalar(PN_stdfloat value);
|
||||
virtual bool apply_control(PandaNode *node);
|
||||
virtual bool clear_forced_channel();
|
||||
virtual AnimChannelBase *get_forced_channel() const;
|
||||
|
|
@ -99,7 +99,7 @@ public:
|
|||
virtual bool do_update(PartBundle *root, const CycleData *root_cdata,
|
||||
PartGroup *parent, bool parent_changed,
|
||||
bool anim_changed, Thread *current_thread);
|
||||
virtual void do_xform(const LMatrix4f &mat, const LMatrix4f &inv_mat);
|
||||
virtual void do_xform(const LMatrix4 &mat, const LMatrix4 &inv_mat);
|
||||
virtual void determine_effective_channels(const CycleData *root_cdata);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -199,15 +199,15 @@ cull_callback(CullTraverser *trav, CullTraverserData &data) {
|
|||
int this_frame = ClockObject::get_global_clock()->get_frame_count();
|
||||
|
||||
CPT(TransformState) rel_transform = get_rel_transform(trav, data);
|
||||
LPoint3f center = _lod_center * rel_transform->get_mat();
|
||||
float dist2 = center.dot(center);
|
||||
LPoint3 center = _lod_center * rel_transform->get_mat();
|
||||
PN_stdfloat dist2 = center.dot(center);
|
||||
|
||||
if (this_frame != _view_frame || dist2 < _view_distance2) {
|
||||
_view_frame = this_frame;
|
||||
_view_distance2 = dist2;
|
||||
|
||||
// Now compute the lod delay.
|
||||
float dist = sqrt(dist2);
|
||||
PN_stdfloat dist = sqrt(dist2);
|
||||
double delay = 0.0;
|
||||
if (dist > _lod_near_distance) {
|
||||
delay = _lod_delay_factor * (dist - _lod_near_distance) / (_lod_far_distance - _lod_near_distance);
|
||||
|
|
@ -249,7 +249,7 @@ cull_callback(CullTraverser *trav, CullTraverserData &data) {
|
|||
// node's transform.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
CPT(TransformState) Character::
|
||||
calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point, bool &found_any,
|
||||
calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, bool &found_any,
|
||||
const TransformState *transform, Thread *current_thread) const {
|
||||
// This method is overridden by Character solely to provide a hook
|
||||
// to force the joints to update before computing the bounding
|
||||
|
|
@ -375,9 +375,9 @@ merge_bundles(PartBundleHandle *old_bundle_handle,
|
|||
// given frame, the closest one counts.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Character::
|
||||
set_lod_animation(const LPoint3f ¢er,
|
||||
float far_distance, float near_distance,
|
||||
float delay_factor) {
|
||||
set_lod_animation(const LPoint3 ¢er,
|
||||
PN_stdfloat far_distance, PN_stdfloat near_distance,
|
||||
PN_stdfloat delay_factor) {
|
||||
nassertv(far_distance >= near_distance);
|
||||
nassertv(delay_factor >= 0.0f);
|
||||
_lod_center = center;
|
||||
|
|
@ -400,7 +400,7 @@ set_lod_animation(const LPoint3f ¢er,
|
|||
////////////////////////////////////////////////////////////////////
|
||||
void Character::
|
||||
clear_lod_animation() {
|
||||
_lod_center = LPoint3f::zero();
|
||||
_lod_center = LPoint3::zero();
|
||||
_lod_far_distance = 0.0f;
|
||||
_lod_near_distance = 0.0f;
|
||||
_lod_delay_factor = 0.0f;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public:
|
|||
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
|
||||
|
||||
virtual CPT(TransformState)
|
||||
calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point,
|
||||
calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
|
||||
bool &found_any,
|
||||
const TransformState *transform,
|
||||
Thread *current_thread) const;
|
||||
|
|
@ -66,9 +66,9 @@ PUBLISHED:
|
|||
void merge_bundles(PartBundleHandle *old_bundle_handle,
|
||||
PartBundleHandle *other_bundle_handle);
|
||||
|
||||
void set_lod_animation(const LPoint3f ¢er,
|
||||
float far_distance, float near_distance,
|
||||
float delay_factor);
|
||||
void set_lod_animation(const LPoint3 ¢er,
|
||||
PN_stdfloat far_distance, PN_stdfloat near_distance,
|
||||
PN_stdfloat delay_factor);
|
||||
void clear_lod_animation();
|
||||
|
||||
CharacterJoint *find_joint(const string &name) const;
|
||||
|
|
@ -139,10 +139,10 @@ private:
|
|||
int _view_frame;
|
||||
double _view_distance2;
|
||||
|
||||
LPoint3f _lod_center;
|
||||
float _lod_far_distance;
|
||||
float _lod_near_distance;
|
||||
float _lod_delay_factor;
|
||||
LPoint3 _lod_center;
|
||||
PN_stdfloat _lod_far_distance;
|
||||
PN_stdfloat _lod_near_distance;
|
||||
PN_stdfloat _lod_delay_factor;
|
||||
bool _do_lod_animation;
|
||||
|
||||
// Statistics
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ CharacterJoint(const CharacterJoint ©) :
|
|||
CharacterJoint::
|
||||
CharacterJoint(Character *character,
|
||||
PartBundle *root, PartGroup *parent, const string &name,
|
||||
const LMatrix4f &default_value) :
|
||||
const LMatrix4 &default_value) :
|
||||
MovingPartMatrix(parent, name, default_value),
|
||||
_character(character)
|
||||
{
|
||||
|
|
@ -191,7 +191,7 @@ update_internals(PartBundle *root, PartGroup *parent, bool self_changed,
|
|||
// joint.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CharacterJoint::
|
||||
do_xform(const LMatrix4f &mat, const LMatrix4f &inv_mat) {
|
||||
do_xform(const LMatrix4 &mat, const LMatrix4 &inv_mat) {
|
||||
_initial_net_transform_inverse = inv_mat * _initial_net_transform_inverse;
|
||||
|
||||
MovingPartMatrix::do_xform(mat, inv_mat);
|
||||
|
|
@ -421,7 +421,7 @@ get_local_transforms() {
|
|||
// indicated matrix.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CharacterJoint::
|
||||
get_transform(LMatrix4f &transform) const {
|
||||
get_transform(LMatrix4 &transform) const {
|
||||
transform = _value;
|
||||
}
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ get_transform(LMatrix4f &transform) const {
|
|||
// the indicated matrix.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CharacterJoint::
|
||||
get_net_transform(LMatrix4f &transform) const {
|
||||
get_net_transform(LMatrix4 &transform) const {
|
||||
transform = _net_transform;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ protected:
|
|||
PUBLISHED:
|
||||
CharacterJoint(Character *character,
|
||||
PartBundle *root, PartGroup *parent, const string &name,
|
||||
const LMatrix4f &default_value);
|
||||
const LMatrix4 &default_value);
|
||||
virtual ~CharacterJoint();
|
||||
|
||||
public:
|
||||
|
|
@ -48,7 +48,7 @@ public:
|
|||
virtual bool update_internals(PartBundle *root, PartGroup *parent,
|
||||
bool self_changed, bool parent_changed,
|
||||
Thread *current_thread);
|
||||
virtual void do_xform(const LMatrix4f &mat, const LMatrix4f &inv_mat);
|
||||
virtual void do_xform(const LMatrix4 &mat, const LMatrix4 &inv_mat);
|
||||
|
||||
PUBLISHED:
|
||||
bool add_net_transform(PandaNode *node);
|
||||
|
|
@ -63,8 +63,8 @@ PUBLISHED:
|
|||
void clear_local_transforms();
|
||||
NodePathCollection get_local_transforms();
|
||||
|
||||
void get_transform(LMatrix4f &transform) const;
|
||||
void get_net_transform(LMatrix4f &transform) const;
|
||||
void get_transform(LMatrix4 &transform) const;
|
||||
void get_net_transform(LMatrix4 &transform) const;
|
||||
|
||||
Character *get_character() const;
|
||||
|
||||
|
|
@ -104,8 +104,8 @@ public:
|
|||
PT(PandaNode) _geom_node;
|
||||
|
||||
// These are filled in as the joint animates.
|
||||
LMatrix4f _net_transform;
|
||||
LMatrix4f _initial_net_transform_inverse;
|
||||
LMatrix4 _net_transform;
|
||||
LMatrix4 _initial_net_transform_inverse;
|
||||
|
||||
public:
|
||||
virtual TypeHandle get_type() const {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ CharacterVertexSlider::
|
|||
// Access: Published, Virtual
|
||||
// Description: Returns the current slider value.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float CharacterVertexSlider::
|
||||
PN_stdfloat CharacterVertexSlider::
|
||||
get_slider() const {
|
||||
return _char_slider->_value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ PUBLISHED:
|
|||
|
||||
INLINE const CharacterSlider *get_char_slider() const;
|
||||
|
||||
virtual float get_slider() const;
|
||||
virtual PN_stdfloat get_slider() const;
|
||||
|
||||
private:
|
||||
PT(CharacterSlider) _char_slider;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ JointVertexTransform::
|
|||
// Description: Stores the transform's matrix in the indicated object.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void JointVertexTransform::
|
||||
get_matrix(LMatrix4f &matrix) const {
|
||||
get_matrix(LMatrix4 &matrix) const {
|
||||
check_matrix();
|
||||
matrix = _matrix;
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ get_matrix(LMatrix4f &matrix) const {
|
|||
// previous.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void JointVertexTransform::
|
||||
mult_matrix(LMatrix4f &result, const LMatrix4f &previous) const {
|
||||
mult_matrix(LMatrix4 &result, const LMatrix4 &previous) const {
|
||||
check_matrix();
|
||||
result.multiply(_matrix, previous);
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ mult_matrix(LMatrix4f &result, const LMatrix4f &previous) const {
|
|||
// result of several blended transforms.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void JointVertexTransform::
|
||||
accumulate_matrix(LMatrix4f &accum, float weight) const {
|
||||
accumulate_matrix(LMatrix4 &accum, PN_stdfloat weight) const {
|
||||
check_matrix();
|
||||
|
||||
accum._m.m._00 += _matrix._m.m._00 * weight;
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ PUBLISHED:
|
|||
|
||||
INLINE const CharacterJoint *get_joint() const;
|
||||
|
||||
virtual void get_matrix(LMatrix4f &matrix) const;
|
||||
virtual void mult_matrix(LMatrix4f &result, const LMatrix4f &previous) const;
|
||||
virtual void accumulate_matrix(LMatrix4f &accum, float weight) const;
|
||||
virtual void get_matrix(LMatrix4 &matrix) const;
|
||||
virtual void mult_matrix(LMatrix4 &result, const LMatrix4 &previous) const;
|
||||
virtual void accumulate_matrix(LMatrix4 &accum, PN_stdfloat weight) const;
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ private:
|
|||
|
||||
PT(CharacterJoint) _joint;
|
||||
|
||||
LMatrix4f _matrix;
|
||||
LMatrix4 _matrix;
|
||||
bool _matrix_stale;
|
||||
LightMutex _lock;
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ make_vertex_columns(GeomVertexArrayFormat *format) const {
|
|||
|
||||
nassertr(_column_name != NULL, 0);
|
||||
|
||||
format->add_column(_column_name, _num_bound_params, GeomEnums::NT_float32, _column_contents);
|
||||
format->add_column(_column_name, _num_bound_params, GeomEnums::NT_stdfloat, _column_contents);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include "config_collada.h"
|
||||
#include "referenceCount.h"
|
||||
#include "pvector.h"
|
||||
#include "pta_LVecBase4f.h"
|
||||
#include "pta_LVecBase4.h"
|
||||
#include "internalName.h"
|
||||
#include "geomEnums.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ load_light(domLight &light, PandaNode *parent) {
|
|||
lnode = DCAST(LightNode, alight);
|
||||
|
||||
domFloat3 &color = ambient->getColor()->getValue();
|
||||
alight->set_color(Colorf(color[0], color[1], color[2], 1.0));
|
||||
alight->set_color(LColor(color[0], color[1], color[2], 1.0));
|
||||
}
|
||||
|
||||
// Check for a directional light.
|
||||
|
|
@ -478,7 +478,7 @@ load_light(domLight &light, PandaNode *parent) {
|
|||
lnode = DCAST(LightNode, dlight);
|
||||
|
||||
domFloat3 &color = directional->getColor()->getValue();
|
||||
dlight->set_color(Colorf(color[0], color[1], color[2], 1.0));
|
||||
dlight->set_color(LColor(color[0], color[1], color[2], 1.0));
|
||||
dlight->set_direction(LVector3f(0, 0, -1));
|
||||
}
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ load_light(domLight &light, PandaNode *parent) {
|
|||
lnode = DCAST(LightNode, plight);
|
||||
|
||||
domFloat3 &color = point->getColor()->getValue();
|
||||
plight->set_color(Colorf(color[0], color[1], color[2], 1.0));
|
||||
plight->set_color(LColor(color[0], color[1], color[2], 1.0));
|
||||
|
||||
LVecBase3f atten (1.0f, 0.0f, 0.0f);
|
||||
domTargetable_floatRef fval = point->getConstant_attenuation();
|
||||
|
|
@ -515,7 +515,7 @@ load_light(domLight &light, PandaNode *parent) {
|
|||
lnode = DCAST(LightNode, slight);
|
||||
|
||||
domFloat3 &color = spot->getColor()->getValue();
|
||||
slight->set_color(Colorf(color[0], color[1], color[2], 1.0));
|
||||
slight->set_color(LColor(color[0], color[1], color[2], 1.0));
|
||||
|
||||
LVecBase3f atten (1.0f, 0.0f, 0.0f);
|
||||
domTargetable_floatRef fval = spot->getConstant_attenuation();
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue