Game Development Community

Solid Item and collision box

by Vincenzo Selvaggio · in Torque Game Engine · 12/05/2006 (9:38 am) · 4 replies

Hi,
I'm new with the engine, I'm trying to create my first item: a ball.
1. Setting the properties (mass, drag, elasticity...) the movement looks good, but I'd like the player doesn't walk through the ball as it happens for Static Shape. Also if I create two ball items, one of them can go through the other one.
2. Is there a way to have the collision box grater than the shape dimension? I mean like we can set the boundingBox of the player. With a bigger collision box I can handle better the collision detection between ball and player, but having a big ball doesn't look good.

If these questions have already an answer please just post me the resource link, I do not find it using site search.

Thank you.
Vincenzo

#1
12/05/2006 (3:09 pm)
How about using Rigid Shape? It Fun and easy, and already do what you wish. Plus its already part of the 1.5, I don't know if there is default art in 1.5 for you- but if not download the stuff from that page to fiddle around with...
#2
12/06/2006 (10:04 am)
Hi,
thank you very much, I don't think I could have been a better answer.
#3
12/06/2006 (10:27 am)
I also have a better build datablock that comes with explanations for what the variables mean, and I tested and removed all the Physics variables that actually DONT do anything.

datablock RigidShapeData( testbox )
{	
   category = "RigidShape"; 
   shapeFile = "~/data/shapes/YOUR DTS HERE.dts"; 
   emap = true;

////////////////////////////////Physics Data

   mass       = 100;          // MASS amount
                                  
   drag = 0.07;                                 
   bodyFriction = 0.01;      // Higher = more friction dampen contact/collision forces.
                             // How slick it is 0=teflon
   
   bodyRestitution = 0.20;    //restitution value affects the strength  
                              // of the body's rebound resulting from 
                              //collisions with objects.
                              // Higher restitution values yield more
                              // powerful rebound reactions. 1=supper bouncy
        
   dragForce = 20.15;   //simulate the constant drag 
   vertFactor = 0.01;  //scalar applied to the velocity drag

   integration = 1;         //discrete steps with which to process 
                            // physics data per tick (lower is less CPU time?)
                            
   collisionTol = 0.15;    //minimum collision velocity to trigger a collision contact
   contactTol = 0.33;      //minimum collision velocity to trigger a full collision
                           // 1 makes it SINK IE: no collision 
   
////////////////////////////////Effects Data

//   minImpactSpeed = 5;        // speed  for the OnImpact script callback
//   softImpactSpeed = 5;       // Minimum speed to Play this Impact Sound
//   hardImpactSpeed = 15; 
   
/////Splash Data   
//splashFreqMod 	= 300.0;       //frequency modulation of a splash 
//splashVelEpsilon = 0.5;       //threshold speed at which  movement to have stopped
//splashEmitter = ParticleEmitterData; //pointers to ParticleEmitterData datablocks 

/////Audio Details
//exitSplashSoundVelocity   = 2.0;//minimum Velocity for the splash sound to be played
//softSplashSoundVelocity   = 1.0;        
//mediumSplashSoundVelocity = 2.0;
//hardSplashSoundVelocity   = 3.0;

/////Audio Data
//softImpactSound   = NULL; //object of type AudioProfile
//hardImpactSound   = NULL;
//exitingWater      = NULL;
//impactWaterEasy   = NULL;
//impactWaterMedium = NULL;
//impactWaterHard   = NULL;
//waterWakeSound    = NULL;

/////Dust Emitter Details
//triggerDustHeight = 3.0;      // Maximum height from the ground will generate dust
//dustHeight        = 1.0;      // Height of dust effects.
//dustEmitter       = ParticleEmitterData; //pointers to ParticleEmitterData datablocks	

/////Damage Details
//numDmgEmitterAreas     = 0.0;  	//The number of areas that can display damage effects
//damageEmitter          = ParticleEmitterData; //pointers to ParticleEmitterDataBlocks
//damageEmitterOffset[0] = "1.0 1.0 1.0";//Offset point to display damage effects.
};

The '////////////////////////////////Effects Data' part i have not yet tested...
#4
12/13/2006 (6:01 am)
Thank you again,
Rigid Shape works fine as a solid item, but I was having issue to get my ball bouncy.
Now I'll try your suggestion on how to set the phys parameters.