Game Development Community

MountedImage Dont Collide and Collided Item Object Increase Z Axis

by Boğaz Harbi · in Torque 3D Professional · 01/26/2010 (6:34 am) · 5 replies

I have two problems about Torque 3D 1.1 Alpha weapon and item collision system.

1) As it seen on the video when a character goes on the weapon, collision has become and weapon goes up to the Z axis.


2) I can't add collision to mountedImage. Mounted wepon's front side is not collided and it goes to all visible meshes inside on the scene. You can see it's videos too above


Thanks for your attention...

About the author

We are working on FPS game project called Boğaz Harbi : Epic of Gallipoli War at Kodgraf Game Studio in Ankara, Turkey. http://www.bogazharbi.com/en http://www.bogazharbigame.com http://twitter.com/bogazharbigame http://facebook.com/bogazharbigame


#1
01/27/2010 (10:06 am)
Friends, who have actually encountered this problem yet?
Steve?
Konrad?
Are you there?
#3
02/02/2010 (12:01 pm)
Yawwwwwwwwwn ... morning ... okay mid-afternoon really

1) WTF!?!?!? Not seen that before - maybe turn "collideable" off, it's an item, it already knows it can be picked up. Also make sure the model has a bounds box, and the pickup area is controlled in (art)player.cs, try making that bigger.

2) Mounted objects don't collide ... or they'd have problems mounting on their user object (though I think someone -Dan Buckmaster- fixed this in old TGE), however you can get "push back" at the barrel by having a node on the weapon called muzzlepoint or ... something else - I've forgotten the other name, check the stock rocketlauncher model in the Shape editor for node names. This "push back" only works when using eyeoffset in the weapon script (which I believe you are).

Also note that somethings in 1.1alpha are broken and should be fixed in the beta (hopefully!).
#4
02/02/2010 (1:12 pm)
Thank you Steve, but I have done different in any of the results did not change.

1) My Item "collidable" option turned off and try picked big area in (art) player.cs but unfortunately did not have any change.

void Player:: _findContact (SceneObject ** contactObject, VectorF * contactNormal) method as follows in the contents of my eye was hit by a code.

void Player::_findContact( SceneObject **contactObject, VectorF *contactNormal )
{
   Point3F pos;
   getTransform().getColumn(3,&pos);

   Box3F wBox;
   Point3F exp(0,0,sTractionDistance);
   wBox.minExtents = pos + mScaledBox.minExtents - exp;
   wBox.maxExtents.x = pos.x + mScaledBox.maxExtents.x;
   wBox.maxExtents.y = pos.y + mScaledBox.maxExtents.y;
   wBox.maxExtents.z = pos.z + mScaledBox.minExtents.z + sTractionDistance;

   static ClippedPolyList polyList;
   polyList.clear();
   polyList.doConstruct();
   polyList.mNormal.set(0.0f, 0.0f, 0.0f);
   polyList.setInterestNormal(Point3F(0.0f, 0.0f, -1.0f));

   polyList.mPlaneList.setSize(6);
   polyList.mPlaneList[0].setYZ(wBox.minExtents, -1.0f);
   polyList.mPlaneList[1].setXZ(wBox.maxExtents, 1.0f);
   polyList.mPlaneList[2].setYZ(wBox.maxExtents, 1.0f);
   polyList.mPlaneList[3].setXZ(wBox.minExtents, -1.0f);
   polyList.mPlaneList[4].setXY(wBox.minExtents, -1.0f);
   polyList.mPlaneList[5].setXY(wBox.maxExtents, 1.0f);
   Box3F plistBox = wBox;

   // Expand build box as it will be used to collide with items.
   // PickupRadius will be at least the size of the box.
   F32 pd = (F32)mDataBlock->pickupDelta;
   wBox.minExtents.x -= pd; wBox.minExtents.y -= pd;
   wBox.maxExtents.x += pd; wBox.maxExtents.y += pd;
   wBox.maxExtents.z = pos.z + mScaledBox.maxExtents.z; //BHD
   
   // Build list from convex states here...
   CollisionWorkingList& rList = mConvex.getWorkingList();
   CollisionWorkingList* pList = rList.wLink.mNext;
   U32 mask = isGhost() ? sClientCollisionContactMask : sServerCollisionContactMask;
   while (pList != &rList)
   {
      Convex* pConvex = pList->mConvex;

      U32 objectMask = pConvex->getObject()->getTypeMask();

      // Check: triggers, corpses and items...
      //
      if (objectMask & TriggerObjectType)
      {
         Trigger* pTrigger = static_cast<Trigger*>(pConvex->getObject());
         pTrigger->potentialEnterObject(this);
      }
      else if (objectMask & CorpseObjectType)
      {
         // If we've overlapped the worldbounding boxes, then that's it...
         if (getWorldBox().isOverlapped(pConvex->getObject()->getWorldBox()))
         {
            ShapeBase* col = static_cast<ShapeBase*>(pConvex->getObject());
            queueCollision(col,getVelocity() - col->getVelocity());
         }
      }
      else if (objectMask & ItemObjectType)
      {
         // If we've overlapped the worldbounding boxes, then that's it...
         Item* item = static_cast<Item*>(pConvex->getObject());
         if (getWorldBox().isOverlapped(item->getWorldBox()))
            if (this != item->getCollisionObject())
				queueCollision(item,getVelocity() - item->getVelocity()); ///BHD
			   
      }

The above "/ / BHD" in the line marked with a lot of changes were made. How to do a change in general and how to fix the problem, I could not find.

2) Have told you the address of changes could you give? Because it does not collide other objects I think of is ridiculous.

When will there be a beta version in the meantime, you know?
#5
02/02/2010 (1:25 pm)
Don't have the links. Check out Daniel Buckmaster's profile for his blogs and resources.

But you should get "push back" retraction with either (or both) a muzzlePoint and retractionPoint node on your model.

No idea when the beta is out ... soonish hopefully.