A blog of group project progress made throughout the assignment.
|
|
comments (0)
|
const MeshPtr& Ogre::Entity::getMesh ( void ) const
Gets the Mesh that this Entity is based on.
SubMesh * getSubMesh (unsigned short index) const
Gets a pointer to the submesh indicated by the index.
void Ogre::SubMesh::generateExtremes ( size_t count )
Generate the submesh extremes (.See also:extremityPoints).
Parameters: count Number of extreme points to compute for the submesh.
|
|
comments (0)
|
how about we add yet another class to gui for collisions? a collisions class. We could use spheres as well as boxes, but the boxes are closer for more of the time. Spheres have a constant issue with empty space around the mesh.
Here's some kinda bad c++/ogre code I found. We need to remove the framelistener stuff
class CollisionManager :
public PersistentFrameListener
{
public:
~CollisionManager();
static CollisionManager& Instance()
{
static CollisionManager instance;
return instance;
}
void Startup();
void Shutdown();
void AddCollisionObject(CollisionObject* object);
void RemoveCollisionObject(CollisionObject* object);
bool FrameEnded(const FrameEvent& evt);
protected:
CollisionManager();
void AddNewObjects();
void RemoveDeletedObjects();
CollisionObjectList collisionObjectList;
CollisionObjectList newObjects;
CollisionObjectList deletedObjects;
};
void CollisionManager::AddCollisionObject(CollisionObject* object)
{
newObjects.push_back(object);
}
void CollisionManager::RemoveCollisionObject(CollisionObject* object)
{
deletedObjects.push_back(object);
}
void CollisionManager::AddNewObjects()
{
for (CollisionObjectList::iterator iter = newObjects.begin();
iter != newObjects.end(); ++iter)
{
collisionObjectList.push_back(*iter);
}
newObjects.clear();
}
void CollisionManager::RemoveDeletedObjects()
{
for (CollisionObjectList::iterator iter = deletedObjects.begin();
iter != deletedObjects.end(); ++iter)
{
collisionObjectList.remove(*iter);
}
deletedObjects.clear();
}
bool CollisionManager::FrameEnded(const FrameEvent& evt)
{
AddNewObjects();
RemoveDeletedObjects();
for (CollisionObjectList::iterator iter1 = collisionObjectList.begin();
iter1 != collisionObjectList.end(); ++iter1)
{
CollisionObjectList::iterator iter2 = iter1;
++iter2;
for ( ; iter2 != collisionObjectList.end(); ++iter2)
{
CollisionObject* const object1 = *iter1;
CollisionObject* const object2 = *iter2;
if (object1->IsStarted() && object2->IsStarted())
{
const Sphere& object1Sphere = object1->GetBoundingSphere();
const Sphere& object2Sphere = object2->GetBoundingSphere();
if (object1Sphere.intersects(object2Sphere))
{
object1->Collision(object2);
object2->Collision(object1);
}
}
}
}
return true;
}
|
|
comments (0)
|
Ok so:
Entity class has a function: const AxisAlignedBox & getBoundingBox (void) const
which if we use on two boats that are known to be close (since we don't want to constantly check every boat every tick), then we can use the:
AxisAlignedBox Ogre::AxisAlignedBox::intersection ( const AxisAlignedBox & b2 ) const
or more likely:
bool Ogre::AxisAlignedBox::intersects ( const AxisAlignedBox & b2 ) const
function to find out if they intersect, and if they do we may assume they collided.
Problem:
If boats are diagonal, then boxes may collide but not boats, yet it will count as a collision.
Where and how to check for collisions:
in a tick function, but where? Has to have access to list of state entities.
How to make this fast? With hundreds or boats and each checking for colisions each tick...
We need to look at some of those existing collision detection systems and see if they have a better way (or if we can even understand what they're doing).
But first, we must fix Helm and MoveTo
|
|
comments (0)
|
Ships spawn now, but...some are not along axis some are...
still no turning.
|
|
comments (0)
|
Have menus and buttons, but can't figure out how to create new ships. Too many errors when I tried using state and entity functions...
|
|
comments (0)
|
I had no internet most of the day yeterday, so I made almost no progress.
Today I have almost finished EButton. It just needs some code for running whatever function is passed to it from guiManager. So what should it do besides change color?
I tried to fix the boat turning, still not sure what makes it turn so slow: Max_rudder, rot_drag, etc don't seem to make much difference...
Did some more on MoveTo, but can't really test it without helm.
|
|
comments (0)
|
I haven't even started on the assigned stuff yet. I am still trying to figure out the physics. The ship goes forward and backwards (instantly changing between them), but I can't get it to turn. Any ideas?
|
|
comments (0)
|
I've created stubs for EButton and EMenu...and created the missing ai file in eva. But I haven't filled it in with anything, so it won't compile. I'm kinda working on EButton, so if someone would try to figure out what ai (containing helm and moveTo) need, that would be nice.
|
|
comments (0)
|
Backup and save all the code from the last Assignment somewhere on your computer.
I've updated the repository with all of our .py files. Once you have Mercurial, and MercurialHg, right click on your engine folder, and turn it into a repository using the MercurialHG command in the pop up.
mk:@MSITStore:C:\Program%20Files%20(x86)\TortoiseHg\doc\TortoiseHg.chm::/quick.html#configuring-tortoisehg
Use the quick start mercurialHG to help set up the thing. When your push (or clone) and it asks for username and password, use your gmail address as username and the password Kk9xq6MZ5gT7 generated by google to update.
I'm going to have designs and quizzes to grade this weekend.
hmy:
|
|
comments (0)
|
Just finished assignment due tomorrow, realized we didn't have a site yet, thought we ought to take care of that.