mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
restored horizontal collision mode, still being used
This commit is contained in:
parent
d05d89a5e4
commit
509e414ef4
@ -13,3 +13,22 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CollisionHandlerPusher::set_horizontal
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE void CollisionHandlerPusher::
|
||||||
|
set_horizontal(bool flag) {
|
||||||
|
_horizontal = flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CollisionHandlerPusher::get_horizontal
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE bool CollisionHandlerPusher::
|
||||||
|
get_horizontal() const {
|
||||||
|
return _horizontal;
|
||||||
|
}
|
||||||
|
@ -43,6 +43,7 @@ public:
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
CollisionHandlerPusher::
|
CollisionHandlerPusher::
|
||||||
CollisionHandlerPusher() {
|
CollisionHandlerPusher() {
|
||||||
|
_horizontal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -119,9 +120,12 @@ handle_entries() {
|
|||||||
} else {
|
} else {
|
||||||
// Shove it just enough to clear the volume.
|
// Shove it just enough to clear the volume.
|
||||||
if (!surface_point.almost_equal(interior_point)) {
|
if (!surface_point.almost_equal(interior_point)) {
|
||||||
|
if (_horizontal) {
|
||||||
|
normal[2] = 0.0f;
|
||||||
|
}
|
||||||
// Just to be on the safe size, we normalize the normal
|
// Just to be on the safe size, we normalize the normal
|
||||||
// vector, even though it really ought to be unit-length
|
// vector, even though it really ought to be unit-length
|
||||||
// already.
|
// already (unless we just forced it horizontal, above).
|
||||||
normal.normalize();
|
normal.normalize();
|
||||||
|
|
||||||
ShoveData sd;
|
ShoveData sd;
|
||||||
|
@ -31,6 +31,9 @@ PUBLISHED:
|
|||||||
CollisionHandlerPusher();
|
CollisionHandlerPusher();
|
||||||
virtual ~CollisionHandlerPusher();
|
virtual ~CollisionHandlerPusher();
|
||||||
|
|
||||||
|
INLINE void set_horizontal(bool flag);
|
||||||
|
INLINE bool get_horizontal() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool handle_entries();
|
virtual bool handle_entries();
|
||||||
virtual void apply_net_shove(
|
virtual void apply_net_shove(
|
||||||
@ -38,6 +41,8 @@ protected:
|
|||||||
const LVector3f &force_normal);
|
const LVector3f &force_normal);
|
||||||
virtual void apply_linear_force(ColliderDef &def, const LVector3f &force);
|
virtual void apply_linear_force(ColliderDef &def, const LVector3f &force);
|
||||||
|
|
||||||
|
bool _horizontal;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static TypeHandle get_class_type() {
|
static TypeHandle get_class_type() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user