Game Development Community

VehicleObjectType

by Howard Dortch · in Torque Game Engine · 01/13/2009 (7:31 pm) · 3 replies

I am using the raycast with this mask and can't strike a vehicle

%searchMasks = $TypeMasks::StaticShapeObjectType | $TypeMasks::VehicleObjectType;

// cast ray starting at startPoint ending at endPoint with mask, ignoring %player
%scanTarg = ContainerRayCast (%startPoint, %endPoint, %searchMasks, %player);

Standing looking at a vehicle this ray never hits the vehile.
Anyone have a solution to this?

#1
01/14/2009 (9:19 am)
Does your vehicle object have a LOScol mesh in it? To catch the castRay? If not, try adding one or more of this type of 'collision' mesh to get ray casts connecting with something.
#2
01/14/2009 (11:52 am)
I have other objects like a box StaticShapeObjectType that raycast hits and it only has Collision-1 listed but a box is not a vehicle.
I thought there might be something about a vehicle that raycast can't see but it's mObjectType is set to VehicleObject in the code.
When I build the vehicle I should create an invisible box along with the Collision-1 and call it LOSCol ? So create 2 collision boxes?
#3
01/14/2009 (12:04 pm)
Yes, create another 'type' of collision mesh, LOScol, starting at -9. So try putting a mesh named "LOScol-9" and see what happens.