Thrusters?

Blitz3D Forums/Blitz3D Programming/Thrusters?

asdfasdf(Posted 2005) [#1]
I have a ship that has a bow thruster and a stern thruster. It will have to have to have bow and stern thruster pivot. How do you have a ship parented to those two thrusters and the thruster pivots move with the ship? If I did what I thuoght of, it would create and error beacuse of the ship being parented to itself. Can you really parent the ship to two parents?
Thanks


WolRon(Posted 2005) [#2]
?

First off, what's a box thruster? (Is that supposed to be bow?)

An entity can only have one parent. But an entity can have many children. I assume what you are looking for is a single entity (perhaps a pivot) that will be the parent of all three (ship, bow thruster, stern thruster).

By the way, this question:
Can you really parent the ship to two parents?
makes absolutely no sense.


DH(Posted 2005) [#3]
From what I gather from what your saying:

You want to parent the thrusters to the ship, yet have the ship move based on the direction the thrusters are pointing?

Well, you can go about this in a variety of ways.

1. Detach the thrusters from the ship but know where they are in relation to the ship. After moving the thrusters simply reposition the ship in relation to where it was from the thrusters.
2. Create a pivot and rotate it as you rotate a thruster. Reposition the pivot instead of repositioning the thruster. After moving the pivot, simply move the ship to the pivot's position.
3. Rethink your parenting. As in first parent the thrusters to the ship, and the ship to a pivot, rotate the thrusters as needed. Then parent the thrusters to the pivot, the ship to the thrusters, and move the thrusters as needed (thus moving the ship) and just to keep everything simple, parent everything to nothing and move the pivot's position to match the ships. Rinse and repeat.

There are a few other ways to go about doing this, but they are more math driven and might be completely off base if I took what you said wrongly, thus they might be a waste of my time to describe.

By the way, this question:
Can you really parent the ship to two parents?

makes absolutely no sense.



Makes perfect sense. I often parent to 1 object and then parent to another to get more control. in essence I have parented to 2 parents for more control.


Stevie G(Posted 2005) [#4]
Or you could use a simple verlet system with 2 x pointmasses ( thrusters ) and 1 contraint. A kind of dumbell effect. Once the contraint has been solved, just position the ship in the middle of them and point it to the front thruster. Rotation etc.. it handled for you!!


WolRon(Posted 2005) [#5]
in essence I have parented to 2 parents for more control.
An entity can only have 1 parent as this example shows:
Graphics3D 1024, 768
ship = CreateCube()
bowthruster = CreatePivot()
sternthruster = CreatePivot()
EntityParent ship, bowthruster
EntityParent ship, sternthruster
child1 = GetChild(bowthruster, 1)
child2 = GetChild(sternthruster, 1)
Text 0, 0, child1
Text 0, 20, child2
WaitKey()
End
You can not make an entity a child of two entities.


DH(Posted 2005) [#6]
You can not make an entity a child of two entities.



Yes you can... When you parent A to B, then parent B to C, what do you think A has? Yes, 2 parents!