mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Added 'is_deleted_a/b' methods to PhysxContactPair, to check if actors are already deleted and thus invalid
This commit is contained in:
parent
aec3ff0e3d
commit
082e0781ac
@ -28,6 +28,11 @@ TypeHandle PhysxContactPair::_type_handle;
|
|||||||
PhysxActor *PhysxContactPair::
|
PhysxActor *PhysxContactPair::
|
||||||
get_actor_a() const {
|
get_actor_a() const {
|
||||||
|
|
||||||
|
if (_pair.isDeletedActor[0]) {
|
||||||
|
physx_cat.warning() << "actor A has been deleted" << endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
NxActor *actorPtr = _pair.actors[0];
|
NxActor *actorPtr = _pair.actors[0];
|
||||||
return (actorPtr == NULL) ? NULL : (PhysxActor *)actorPtr->userData;
|
return (actorPtr == NULL) ? NULL : (PhysxActor *)actorPtr->userData;
|
||||||
}
|
}
|
||||||
@ -41,10 +46,39 @@ get_actor_a() const {
|
|||||||
PhysxActor *PhysxContactPair::
|
PhysxActor *PhysxContactPair::
|
||||||
get_actor_b() const {
|
get_actor_b() const {
|
||||||
|
|
||||||
|
if (_pair.isDeletedActor[1]) {
|
||||||
|
physx_cat.warning() << "actor B has been deleted" << endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
NxActor *actorPtr = _pair.actors[1];
|
NxActor *actorPtr = _pair.actors[1];
|
||||||
return (actorPtr == NULL) ? NULL : (PhysxActor *)actorPtr->userData;
|
return (actorPtr == NULL) ? NULL : (PhysxActor *)actorPtr->userData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: PhysxContactPair::is_deleted_a
|
||||||
|
// Access: Published
|
||||||
|
// Description: Returns true if the first of the two actors is
|
||||||
|
// deleted.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool PhysxContactPair::
|
||||||
|
is_deleted_a() const {
|
||||||
|
|
||||||
|
return _pair.isDeletedActor[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: PhysxContactPair::is_deleted_b
|
||||||
|
// Access: Published
|
||||||
|
// Description: Returns true if the second of the two actors is
|
||||||
|
// deleted.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool PhysxContactPair::
|
||||||
|
is_deleted_b() const {
|
||||||
|
|
||||||
|
return _pair.isDeletedActor[1];
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: PhysxContactPair::get_sum_normal_force
|
// Function: PhysxContactPair::get_sum_normal_force
|
||||||
// Access: Published
|
// Access: Published
|
||||||
|
@ -36,6 +36,8 @@ class EXPCL_PANDAPHYSX PhysxContactPair : public TypedReferenceCount {
|
|||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE ~PhysxContactPair();
|
INLINE ~PhysxContactPair();
|
||||||
|
|
||||||
|
bool is_deleted_a() const;
|
||||||
|
bool is_deleted_b() const;
|
||||||
PhysxActor *get_actor_a() const;
|
PhysxActor *get_actor_a() const;
|
||||||
PhysxActor *get_actor_b() const;
|
PhysxActor *get_actor_b() const;
|
||||||
LVector3f get_sum_normal_force() const;
|
LVector3f get_sum_normal_force() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user