Player Collision
by Adam Lindsay · in Torque Game Engine Advanced · 09/29/2007 (8:05 pm) · 5 replies
I have what is turning into an interesting challenge. I am sure there is a solution but, I am having a hard time coming up with it. Here is the scenario:
I wish to design a level where the player controls a wheel. The wheel is freely moveable by the player. The wheel will have an inner diameter and an outer diameter. I will need collision on the inner diameter. Imagine the player placing the wheel on an axle. The axle will need to be able to collide with the inner circle of the wheel.
1. Given the collision requirements, I assume the wheel will need to be a dif since a bounds box won't work?
2. Does this dif need to be the player object (can it be the player object?)
3. If it is not the player object how can I make it look like the wheel is the player moving with the player controls.
I am looking for general design directions in accomplishing this level design. Any help is greatly appreciated.
Thank in advance.
- Adam
I wish to design a level where the player controls a wheel. The wheel is freely moveable by the player. The wheel will have an inner diameter and an outer diameter. I will need collision on the inner diameter. Imagine the player placing the wheel on an axle. The axle will need to be able to collide with the inner circle of the wheel.
1. Given the collision requirements, I assume the wheel will need to be a dif since a bounds box won't work?
2. Does this dif need to be the player object (can it be the player object?)
3. If it is not the player object how can I make it look like the wheel is the player moving with the player controls.
I am looking for general design directions in accomplishing this level design. Any help is greatly appreciated.
Thank in advance.
- Adam
About the author
#2
Imaging the player object is ring. The person playing controls the movement of this ring. I want a complex collision mesh that allows objects to pass through the center of this ring but, collide with the edges. It looks like the vehicle class has more flexible collision possiblities but, I am not finding the information I need.
1. Bounds box vs collsion mesh... How are they different in the engine. Does the bounds box initiate the collision test and the mesh determines if an actual collision occured?
If #1 is the case, the can't I ....
2. Can I create a dts ring, create a collision mesh for it that will allow objects to pass through the center.
If there is no way to do this with the engine as-is, I guess I will have to wipe the dust of my C++ books and get to work but, I don't want to waste the time if I can accomplish this an easier way.
10/05/2007 (8:56 am)
Ok. Before I start digging into C++ code, I want to make sure I cannot do this as is. Here is a different scenario that matches my requirement.Imaging the player object is ring. The person playing controls the movement of this ring. I want a complex collision mesh that allows objects to pass through the center of this ring but, collide with the edges. It looks like the vehicle class has more flexible collision possiblities but, I am not finding the information I need.
1. Bounds box vs collsion mesh... How are they different in the engine. Does the bounds box initiate the collision test and the mesh determines if an actual collision occured?
If #1 is the case, the can't I ....
2. Can I create a dts ring, create a collision mesh for it that will allow objects to pass through the center.
If there is no way to do this with the engine as-is, I guess I will have to wipe the dust of my C++ books and get to work but, I don't want to waste the time if I can accomplish this an easier way.
#3
1) Yes, for the vehicle class. The Player class however does not do the second step--for that class only, if the bounding box indicates a collision, it's treated as a collision.
2) If you use the multiple convex collision hulls I describe above, you should be fine.
10/05/2007 (9:23 am)
If you use the vehicle class, and create convex collision hulls that approximate your ring (think wedges linked together) then you should be fine with no code modifications.1) Yes, for the vehicle class. The Player class however does not do the second step--for that class only, if the bounding box indicates a collision, it's treated as a collision.
2) If you use the multiple convex collision hulls I describe above, you should be fine.
#4
10/05/2007 (11:28 am)
Thanks Stephen. I appreciate the quick response. I will try out your suggestion.
#5
In my tdn research:
http://tdn.garagegames.com/wiki/DTS/3dsmax/Creating_a_Simple_Wheeled_Vehicle
"Vehicles are only allowed one Collision mesh (mesh -1). "
If I create convex collision hulls to approximate the ring, will that be more than one collision mesh?
If I link them together, will the engine consider it one mesh (but would it be concave at that point)?
10/05/2007 (12:10 pm)
@StephenIn my tdn research:
http://tdn.garagegames.com/wiki/DTS/3dsmax/Creating_a_Simple_Wheeled_Vehicle
"Vehicles are only allowed one Collision mesh (mesh -1). "
If I create convex collision hulls to approximate the ring, will that be more than one collision mesh?
If I link them together, will the engine consider it one mesh (but would it be concave at that point)?
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
What you need to do is alter the player class in the C++ source to use a different collision method.
The usage of the bounding box on the player but not on the AI is just a setting.
You might want to look how it is done for the AI players and do it like that for the player as well.