Mounting RigidComponents
by Alex Stittle · in Torque X 3D · 02/18/2009 (4:35 pm) · 3 replies
I decided that I didn't like the way I was handling picking up objects in my game and attempted to change it.
What I would like to do is mount a sphere on my player and then use the collision of the sphere to determine what the player can pick up.
To do this, I decided to make another object with a RigidComponent and mount it to the player.
This worked... sort of. The problem is that the mounted sphere object doesn't follow the player so well. Since it is processing it's own physics, it falls due to gravity (away from my player) and does other funky things. I got around that issue by setting the immovable property to true, but then it seems the collision sphere wasn't moving around with the scene object.
Anyone have a way to mount an object which itself has a rigidcomponent?
What I would like to do is mount a sphere on my player and then use the collision of the sphere to determine what the player can pick up.
To do this, I decided to make another object with a RigidComponent and mount it to the player.
This worked... sort of. The problem is that the mounted sphere object doesn't follow the player so well. Since it is processing it's own physics, it falls due to gravity (away from my player) and does other funky things. I got around that issue by setting the immovable property to true, but then it seems the collision sphere wasn't moving around with the scene object.
Anyone have a way to mount an object which itself has a rigidcomponent?
#2
Ill let you know if I have any breakthrus. please do the same for me.
thank you
02/23/2010 (10:26 pm)
this is a similar problme to what i have. I need to have my sword process collisions, but while it is immovable = true, it wont allow a collsiion response function.Ill let you know if I have any breakthrus. please do the same for me.
thank you
#3
02/24/2010 (1:24 pm)
Have you tried Kinetic?
Torque Owner Alex Stittle
Anyhow, same problem, so I am currently working around it by using my own class derived from T3DTriggerComponent. Then in the process tick functions I copied the scene transform from the player to the sphere trigger.
Like so,
public void ProcessTick(Move move, float dt) { base.ProcessTick(move, dt); _ownerComponentScene.Transform = _followScene.Transform; } public void InterpolateTick(float k) { base.InterpolateTick(k); _ownerComponentScene.Transform = _followScene.Transform; }So I no longer mount the object, but instead move it to the player position every frame. Which is kinda like mounting it.
This isn't exactly ideal, but it's good enough for now.