PRO: Collision processing
by Jemand den es nicht gibt · in Torque Game Builder · 07/07/2006 (11:43 am) · 3 replies
I think there is a bug that makes two objects physically respond even if they are both physic receivers.
I believe the problem is around line 7136 of the file t2dSceneObject.cc(I am not posting code.. not sure if that is allowed).
The if just checks if they are either senders or receivers and fires even if neither of them is a sender.
I believe the problem is around line 7136 of the file t2dSceneObject.cc(I am not posting code.. not sure if that is allowed).
The if just checks if they are either senders or receivers and fires even if neither of them is a sender.
#2
07/07/2006 (11:58 am)
Okay, Torqued and me just tried this out and it did the trick... that bug drove me crazy all day, a hard find. :)
#3
As you can see, Fenix(player) is a physical sender and the Wasp a physical receiver. However ingame the wasp happily pushes Fenix about even though it should be the other way around.
07/07/2006 (12:20 pm)
Seems this still didn't fix all problems. I have to objects using the following configs:datablock t2dSceneObjectDatablock(WaspConfig)
{
GraphGroup = $GAME::EnemyGroup;
Layer = $GAME::GameObjectLayer;
Size = "5 5";
Class = "Wasp";
CollisionActiveReceive = "1";
CollisionActiveSend = "0";
CollisionPhysicsReceive = "1";
CollisionPhysicsSend = "0";
CollisionCallback = "1";
CollisionGroups = 0;
};
datablock t2dSceneObjectDatablock(FenixConfig)
{
GraphGroup = $GAME::FenixGroup;
Layer = $GAME::GameObjectLayer;
Size = "10 10";
Class = "Fenix";
CollisionActiveReceive = "1";
CollisionActiveSend = "1";
CollisionPhysicsReceive = "0";
CollisionPhysicsSend = "1";
CollisionCallback = "1";
CollisionGroups = BIT($GAME::EnemyGroup);
};As you can see, Fenix(player) is a physical sender and the Wasp a physical receiver. However ingame the wasp happily pushes Fenix about even though it should be the other way around.
Torque Owner Jemand den es nicht gibt
(t2dSceneObject.cc, line 7136 ff, ::processCollisionStatus())
// We only need to solve the contacts if we've got physics send enabled on // the source or physics receive on the destination. pCollisionStatus->mSrcSolve = pSrcObject->getCollisionPhysicsSend() && !pSrcObject->processIsMountedRigid(); pCollisionStatus->mDstSolve = pDstObject->getCollisionPhysicsReceive() && !pDstObject->processIsMountedRigid(); // Solve? if ( pCollisionStatus->mSrcSolve || pCollisionStatus->mDstSolve ) { // Yes, so solve collision. if (!pCollisionStatus->mSrcObject->getNeverSolvePhysics() && !pCollisionStatus->mDstObject->getNeverSolvePhysics()) t2dPhysics::solveCollision( pCollisionStatus ); }The problem is, that the stuff in the if-clause gets fired even if both objects are receivers for physics which is wrong(at least it wouldn't make much sense to me).
Maybe the || should be a && ?