ErlendHL
1313 posts
|
Heyo.
In my game there are Organisms floating around in a liquid, bird view. Every organism is described by a vector of Limbs. You can consider ever Limb a shape. It’s defined by a vector of Lines. Every Line has two properties right now: rotation and length. That is enough information for me to properly draw an Organism. But I’m concerned about when I’m gonna start with the physics. Is it enough just to know the length and rotation of every Line in a Limb to work with physics?
Edit: I forgot to mention, the Lines are drawn in the order they appear in the Limb’s vector of Lines. So the first Line would start at [0, 0], and end at a coordinate calculated using its rotation and length. The next line would start at the end of the previous line, etc.
Thanks!!!!1
|
Mond
749 posts
|
You have magnitude and direction for each line segment. I would store the endpoints as I calculated them to give myself a full set of defining geometry to work with. Especially if the Organisms were not dynamic (they don’t change shape).
|
ErlendHL
1313 posts
|
Originally posted by Mond:
You have magnitude and direction for each line segment. I would store the endpoints as I calculated them to give myself a full set of defining geometry to work with. Especially if the Organisms were not dynamic (they don’t change shape).
Thanks for the answer. You’re right , but maybe I should make it start points instead of end points, considering I may make it possible for the organism to lose Lines in the future. (so I would have single Lines floating around)
And that considered, I imagine it would be natural to make the shapes dynamic as you mentioned, so they were wobbly. I’m not sure how I would proceed doing that thought.. The Limbs are attached to a joint (between two Lines) on another Limb (except the “main limb” of the organism), and the organism should be able to rotate its limbs. If I made the limbs dynamic, I guess the only natural way to rotate the limbs would be to rotate the two Lines at the pivot, explanation:

I’ve got no clue how to implement physics in order to have wobbly limbs (dynamic), but if it’s doable I will do it. So the question now is static or dynamic…
|
Mond
749 posts
|
If the Organism can change shape, then storing the endpoints of each segment (starting and ending) when you initially draw it would serve no purpose since the endpoint values will change dynamically as the game plays. If the Organism was only going to translate (and maybe rotate about the registration point) then storing the initial endpoints for each segment would be worthwhile.
|