Code center > Darwinbots3
Darwinbots 3 Progress
Prsn828:
Ah the physics...
Well, I suppose I should commit what I have of it so others can build off of that.
I'm positive it still compiles because I hate not being able to compile after finishing a section of code, so I will send what I have done.
bacillus:
I would probably be best at getting the physics engine set up. I've been writing one myself, and although it's still primitive compared to the stuff you posted on the wiki, It'll give me a background on how the functions are derived.
To be honest, C# is new territory for me. I understand how the syntax works, but calling up specific functions like UI and stuff like that is a bit of a mystery for me. I started an unrelated project to familiarize myself as I go along...
bacillus:
I'm trying to complete the collision physics code atm, but a few questions popped up:
1-Is the collision normal a positioned vector perpendicular to the collision interface, or is it measured from the center to collision interface?
2-I'm guessing j0 is equal but opposite for both mass systems. Anything wrong with this assumption?
3-Is there any auto-complete function in C# Visual Studio?
Numsgil:
1. Suppose you have a collision between a vertex and an edge. The collision normal is usually perpendicular to the edge. In more convoluted cases it's just a best guess. For the collision response code, assume that you are given the normal as part of the input into the function.
2. This is technically true. However to allow for the system of equations to be solved easily you assume j0 is equal to the impulse along n, and then just remember to negate it when you apply it to the second body.
3. You mean like intellisense? There should be.
So I'm guessing you found this page, right? The case of one-on-one collision should be not too hard. Make sure to add a bunch of tests for it for weird cases (0 or infinite mass, etc.).
Multiple collisions is more speculative. This is really something I've figured out on my own just from first principles, so I'm not totally sure what I'm doing
bacillus:
I see how you got that from FP, but I think it's just a case of each object resolving each of its collisions as though they were different single collisions. Remember that the other masses can be reduced to a single mass as they are all external of the concerned mass.
Okay, so j0 represents the scalar exertion upon an object, and n the direction of change, so therefore should have a magnitude of 1. mass/moment of inertia convert the 'force' into an 'instantaneous' acceleration/torque. j0 is acting perpendicular to the center about a point, eg. a tangent.
Okay, that makes sense. But is the code for calculating the normal/tangent/impulse already in place?
EDIT => Are the Azimuth files corrupt? I've tried to update several times at revision 304, but TortoiseSVN still marks it as a deprecated version.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version