Exposing btWheelInfo::RaycastInfo.

This commit is contained in:
enn0x 2012-02-17 21:37:05 +00:00
parent 3a75ebde9a
commit 1d5b7d4c55
4 changed files with 150 additions and 1 deletions

View File

@ -75,7 +75,11 @@ class btTypedConstraint;
class btTypedObject;
class btVector3;
class btVehicleRaycaster;
class btWheelInfo;
class btWheelInfo {
public:
class RaycastInfo;
};
class btCollisionWorld {
public:

View File

@ -22,6 +22,16 @@ INLINE BulletWheel::
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::Destructor
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE BulletWheelRaycastInfo::
~BulletWheelRaycastInfo() {
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheel::empty
// Access: Public
@ -37,3 +47,91 @@ empty() {
return BulletWheel(info);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::is_in_contact
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE bool BulletWheelRaycastInfo::
is_in_contact() const {
return _info.m_isInContact;
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::get_suspension_length
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE PN_stdfloat BulletWheelRaycastInfo::
get_suspension_length() const {
return _info.m_suspensionLength;
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::get_contact_point_ws
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE LPoint3 BulletWheelRaycastInfo::
get_contact_point_ws() const {
return btVector3_to_LPoint3(_info.m_contactPointWS);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::get_hard_point_ws
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE LPoint3 BulletWheelRaycastInfo::
get_hard_point_ws() const {
return btVector3_to_LPoint3(_info.m_hardPointWS);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::get_contact_normal_ws
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE LVector3 BulletWheelRaycastInfo::
get_contact_normal_ws() const {
return btVector3_to_LVector3(_info.m_contactNormalWS);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::get_wheel_direction_ws
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE LVector3 BulletWheelRaycastInfo::
get_wheel_direction_ws() const {
return btVector3_to_LVector3(_info.m_wheelDirectionWS);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::get_wheel_axle_ws
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE LVector3 BulletWheelRaycastInfo::
get_wheel_axle_ws() const {
return btVector3_to_LVector3(_info.m_wheelAxleWS);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::get_ground_object
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE PandaNode *BulletWheelRaycastInfo::
get_ground_object() const {
return _info.m_groundObject ? (PandaNode *)_info.m_groundObject : NULL;
}

View File

@ -24,6 +24,27 @@ BulletWheel(btWheelInfo &info) : _info(info) {
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheelRaycastInfo::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
BulletWheelRaycastInfo::
BulletWheelRaycastInfo(btWheelInfo::RaycastInfo &info) : _info(info) {
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheel::get_raycast_info
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
BulletWheelRaycastInfo BulletWheel::
get_raycast_info() const {
return BulletWheelRaycastInfo(_info.m_raycastInfo);
}
////////////////////////////////////////////////////////////////////
// Function: BulletWheel::get_suspension_rest_length
// Access: Published

View File

@ -23,6 +23,31 @@
#include "luse.h"
#include "pandaNode.h"
////////////////////////////////////////////////////////////////////
// Class : BulletWheelRaycastInfo
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDABULLET BulletWheelRaycastInfo {
PUBLISHED:
INLINE ~BulletWheelRaycastInfo();
INLINE bool is_in_contact() const;
INLINE PN_stdfloat get_suspension_length() const;
INLINE LVector3 get_contact_normal_ws() const;
INLINE LVector3 get_wheel_direction_ws() const;
INLINE LVector3 get_wheel_axle_ws() const;
INLINE LPoint3 get_contact_point_ws() const;
INLINE LPoint3 get_hard_point_ws() const;
INLINE PandaNode *get_ground_object() const;
public:
BulletWheelRaycastInfo(btWheelInfo::RaycastInfo &info);
private:
btWheelInfo::RaycastInfo &_info;
};
////////////////////////////////////////////////////////////////////
// Class : BulletWheel
// Description : One wheel of a BulletVehicle. Instances should not
@ -82,6 +107,7 @@ PUBLISHED:
LMatrix4 get_world_transform() const;
bool is_front_wheel() const;
PandaNode *get_node() const;
BulletWheelRaycastInfo get_raycast_info() const;
public:
BulletWheel(btWheelInfo &info);