This journal is taken from my website: http//:www.cse.ohio-state.edu/~stegemol
where the mentioned documents and code files can be found.
Met with Jedrik today and went over what was to be needed from collsion detection
for the various parts of the project.
What we decided upon:
Geometry:
We realized that at most the most complex objects in our scenes can be represented
either by a simple sphere or box bounding the figure such as spheres around the soldiers
for proximity detection for the flocking sytem or boxes such as for the catapults. The
RagDoll system wil just use a series of boxes to encase individual parts of the soldiers,
upper arm - one box, lower arm - one box etc.
Need:
OBB - Object Bounding Boxes
Spheres
Collision Detection:
Naturally we will need Box/Box, Sphere/Sphere and Box/Sphere collision detection algorithms.
Algorithms:
We decided to use a simple yet robust real-time algorithms so as to speed the necessary calculations
since we want low-level components like these to not add significantly to render times.
Goals ahead:
Implement and Document
Met again with Jed and implemented our code tonight.
I provided some C++ Vector and Matrix classes I had written to help us get the code together
This way we can acutually feed numbers into these modules to check our work as no one has fully
figured out the ins ad outs of the Maya C++ API, yet we need to have the modules established now
so that others can see what their working with. So a C++ implementation for now will work and
and can be ported on into the API as that comes along.
Jed and I emailed Tim and Kevin earlier to see if they needed a 2D Circle/Circle intersection routine, or
if they could just use the full 3D Sphere/Sphere routine and essentially project it onto a plane
making it 2D, they said yes so we proceeded as planned
Jed is needed to work more on the website and having met with Mike it is apparent that collision
detection's next step is collision response which means that until Mike and I have the Rigid
Body dynamics better worked out it will be okay for Jed to step away for a little while.
However he will be back to continue work on Collision
I have finished Coding algortithms for handling collision reponsene but only have used it for spheres for
right now, but it can easily be extended to boxes and as well as planes.
Revelations:
While I was doing this it was readily apparent that I had to integrate collision detection/reponse and
rigid body dynamics from the get go. What I have now are C++ classes that use polymorphism to inherit from
the parent Rigid Body Class. This provided two adavantages: 1) the Maya C++ API use polymorphism quite a bit
and so porting it will be much easier 2) Collision detection and response can be wrapped into the parent class
so we do not have each class carrying its own funcs for this.
The Code:
The code supports Linear Motion & Angular Motion Collision and Reponse, elasticity attentuation, Sphere/Sphere
and Sphere/Plane intersection, constant force (ie gravity) and impulse force application. I have the code included
below as a Opengl implementation ( I was just using Opengl to quickly view the results ) so to run it you'll
GL installed on you computer. Also there are many vestigial funcs still in the code as it needs to be cleaned up. I plan
to use a video capture software so I can post a clip of it working. What you'll see is two spheres shown as boxes
so you can see them rotate, being pulled down by gravity, hitting each other then the ground plane and bouncing off
as the collisions here are totally elastic.
Jedrik has been working on getting the procedures into the maya api so that we may access them in ther mel script
through a series of plugins. Jedrik has been doing most of the work for this and I have been acting as consultant as with
Mike.
Jedrik has been having a few snags here and there but seems to have things in and usable. I have been helping here and there mostly
troubleshooting when things go wrong and helping Jed to setup tests for the plugins.
Met with Mike and shared what we learned from our respective research. We discussed
using a robust approach vs. an approximated approach taking into consideration the time
we have to complete this project we decided to go with a reasonablely accurate approximation
approach to simulating the physical processes.
For collisions we're looking at calcualting an impulse force from the change
in momentum and then using this and the objects Inertia tensor to get the final change in
velocity. For the Ragdoll system we were unclear as to how to actually implement a restraining
of the bodies into their heirarchy positions after being hit by a collision, methods of springs,
a fully restraint solver and other methods were discussed.
I gave Mike some of my resources that better discussed how to go about implementing a ragdoll system
and not just the theory behind it. We resolved to give it better study and meet again to plan hash out
a plan.
Met with Mike again to further discuss our RagDoll system. We explored how we are going to use
a tree structure to hold the heirarchy together and pass transformations along it. This led
to questions of how we are going to enforce joint constraints such as preventing backward bending
elbows. This would require a full constraint solving system and we resolved to look at the problem
FROM MY COLLISION JOURNAL:
Jed is needed to work more on the website and having met with Mike it is apparent that collision
detection's next step is collision response which means that until Mike and I have the Rigid
Body dynamics better worked out it will be okay for Jed to step away for a little while.
However he will be back to continue work on Collision
In regards to this it was decided that in order to get our work under way for Rigid Bodies
I would get the Collision Reponse/Physics Proccessing going while Mike works on the acceleration
structure that will be used to speed up collision detection and processing. Once this is complete
we will come together to put the Ragdoll module together since it depends on collision detection and reponse.
of only keeping the joints from breaking which simplifies the matter and must be determined first
before actual rotation constraints can be considered.
Mike has decded he has enough to work with to start getting the rag doll together. My job now will be to
act as consultant to help use what I have written and troubleshoot any problems.
Mike has shown us a working version of the ragdoll implemented in Opengl. Though it does not support a true constraint system it appears
that it will work for our needs. As it stands the system will use spheres linked together in a heirachy and we will parent Maya skeleton bones to the
spheres which will effect the posing of the model through the transformations on the spheres. Also for our scenes in order to produce motion we will simply
set a impulse force on the nodes at a certain key frame and allow the system to go from there.