| View previous topic :: View next topic |
| Author |
Message |
kurtz
Joined: 02 Apr 2005 Posts: 56
|
Posted: Tue Jun 21, 2005 1:43 pm Post subject: Elevators |
|
|
I was looking to implement mover type objects (like an elevator) that could move other objects, like a player around, but not be moved themselves. (I.e. an elevator could raise and lower other dynamic objects, but could not be hit off course by the player). I was wondering what people thought would be the best way to do this.
I got something sort of working by writing a PreCollisionCallBack function that adjusts the moved objects velocity manually and clears the mover object from the collision. I was wondering if there's a cleaner, better way to do this that anyone can think of. Thanks. |
|
| Back to top |
|
 |
luke Site Admin
Joined: 15 Oct 2004 Posts: 621
|
Posted: Wed Jun 22, 2005 1:36 pm Post subject: |
|
|
You can try using a slider joint for elevators and make it heavy compared to the player to help stop it being knocked off course.
StaticObject has a SetNextFrame function. If you use a StaticObject for the elevator and call SetNextFrame to move it it will give exactly the result you are after. However, this is work in progress and is documented as such. There may be some issues but you can try it if you like. However, at this point, this is not optimized and doing many elevaters at once with static objects may be slow.
It might be possible to add a TA::DynamicObject::SetInfiniteMass() function to TrueAxis in the future to add this type of functionallity.
There is a workaround you might be able to do with PreCollisionCallBack if you are very advetures. It might work.
-You need to remove the moving object from the collision.
-If the moving object is ObjectA in the collision, you will have to make the other object ObjectA and flip v3Normal in the collisoin to point in the oppocite direction.
-Then you can set the fTime to 0.0 and increase fIntersectingDepth relative to how fast the lift is moving.
However, I this could only posibly work for very slow moving lifts. |
|
| Back to top |
|
 |
kurtz
Joined: 02 Apr 2005 Posts: 56
|
Posted: Wed Jun 22, 2005 1:57 pm Post subject: |
|
|
Thanks a lot. I wasn't sure what exactly to adjust to get the right behavior, but I'll try playing around with the intersecting depth a little, and see what happens.
Edit: Tried the SetNextFrame, which seems like it will probably be the best option at some point, but got a bunch of strange issues, so I'll hold off on that for now. |
|
| Back to top |
|
 |
|