Game Development Community

help: colision mask & Mask type how it's works?

by elvince · in Torque 3D Professional · 02/20/2010 (9:15 am) · 2 replies

Hi,

I can get the projectile collision to work on a object that is like RenderMeshExample.

if I look in projectile:
const U32 Projectile::csmStaticCollisionMask =  TerrainObjectType    |
                                                InteriorObjectType   |
                                                StaticObjectType;
In my class:
mTypeMask |= StaticObjectType | StaticTSObjectType | StaticRenderedObjectType;
I understand, projectile should collide with StaticObjectType type, so why it's not working?

More on player, if I remove StaticRenderedObjectType, no collision anymore for Player. I'm little bit lost, if anyone can drive me on the good path I will appreciate.

Thank
Player collision Mask
static U32 sCollisionMoveMask =  TerrainObjectType       |
                                 InteriorObjectType      |
                                 WaterObjectType         | 
                                 PlayerObjectType        |
                                 StaticShapeObjectType   | 
                                 VehicleObjectType       |
                                 PhysicalZoneObjectType  | 
                                 StaticTSObjectType |
                                 ConvexShapeObjectType;

static U32 sServerCollisionContactMask = sCollisionMoveMask |
                                         ItemObjectType     |
                                         TriggerObjectType  |
                                         CorpseObjectType;

static U32 sClientCollisionContactMask = sCollisionMoveMask |
                                         TriggerObjectType;

#1
02/20/2010 (9:47 am)
Projectiles do not collide with all objects.
For example they do not collide with items.
Ok ,may be I am wrong here - they collide,but they don't have a physics response to this collision,because they are not designed to be hit by projectiles.
#2
02/20/2010 (11:08 am)
If fact projectile are not collide because:

Projectile:
mTypeMask |= ProjectileObjectType | LightObjectType;

Item:
const U32 sClientCollisionMask = (TerrainObjectType |
InteriorObjectType | StaticShapeObjectType |
VehicleObjectType | PlayerObjectType |
StaticTSObjectType);

const U32 sServerCollisionMask = (sClientCollisionMask |
TriggerObjectType);

Collision for between player & item is done on Item and not Player! As projectile is not in item Mask for collision, it pass through.