mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
use new NodePath-based interface for physics
This commit is contained in:
parent
1395afcdd9
commit
a5d8325bda
@ -55,10 +55,11 @@ apply_linear_force(ColliderDef &def, const LVector3f &force) {
|
|||||||
if (force == LVector3f::zero()) {
|
if (force == LVector3f::zero()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!def._node) {
|
if (def._target.is_empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ActorNode *actor=DCAST(ActorNode, def._node);
|
ActorNode *actor;
|
||||||
|
DCAST_INTO_V(actor, def._target.node());
|
||||||
LVector3f vel=actor->get_physics_object()->get_velocity();
|
LVector3f vel=actor->get_physics_object()->get_velocity();
|
||||||
if (vel == LVector3f::zero()) {
|
if (vel == LVector3f::zero()) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user