FunCollision v1.0 Source + Bin + Tutorials

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Postby demonicpancake » Tue Jan 25, 2011 9:04 pm

First off, thanks for this library.

One issue I ran into is if you change samplers it doesn't maintain speed due to gravity. Any way to get around that?
demonicpancake
 
Posts: 6
Joined: Tue Jan 25, 2011 8:34 pm

Postby shadowslair » Tue Jan 25, 2011 10:37 pm

In "CCollEntity::setSampler(ICollSampler* Sampler)" you can simply replace the "spawn(pos);" with a "teleport(pos);"- call. This will maintain its velocities/forces/impulses/gravity etc. :wink:

Just keep in mind that switching samplers can lead to issues, unless the entity is in open air. :P
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby demonicpancake » Wed Jan 26, 2011 8:59 pm

shadowslair wrote:In "CCollEntity::setSampler(ICollSampler* Sampler)" you can simply replace the "spawn(pos);" with a "teleport(pos);"- call. This will maintain its velocities/forces/impulses/gravity etc. :wink:

Just keep in mind that switching samplers can lead to issues, unless the entity is in open air. :P


Wow! Fast reply! :)

Worked like a charm! And yeah I'm changing samplers so my player can crouch. What would happen is you could crouch and stand up repeatedly to slow your falling through the air. Kinda weird.

Thanks
demonicpancake
 
Posts: 6
Joined: Tue Jan 25, 2011 8:34 pm

Postby demonicpancake » Tue Feb 08, 2011 8:48 pm

Hmm, my terrain isn't working. I'm falling right through it. I'm creating my terrain as such:

terrain = client->scenemgr->addTerrainSceneNode(s.c_str(),0,1,pos,rot,scale);

And the collision stuff:

CCollTerrainSelector* terrainSelector = collMgr->addTerrainSelector(terrain,2);
terrainSelector->build();
collMgr->addObject(terrainSelector,terrain);

What am I doing wrong?
demonicpancake
 
Posts: 6
Joined: Tue Jan 25, 2011 8:34 pm

Postby shadowslair » Tue Feb 08, 2011 10:30 pm

You`re falling through your terrain visual representation, not through its collision mesh. Creation code seems ok. My guess is that there`s some transforming issue if you transform your terrain node afterwards.
For the test try the LOD 0 to get 1:1 collision with "graphics" mesh and you should definitely try drawing the collision mesh by keeping the terrain coll object pointer and calling "obj->drawDebugData(driver);" (in the place you usually draw stuff manually like text, lines etc. For this you can use the 2nd LOD if the framerate is very low ) . Then take a little look-around-walk to see where actually is your terrain- should appear in cyan. If the two are matching, then you better check your collision entity being a "ghost". :D
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby demonicpancake » Wed Feb 09, 2011 2:45 am

First off, I'm not transforming the node after creation so that shouldn't be a problem. I already tried LOD 0 and (after waiting forever to load) it still doesn't work. The drawDebugData() didn't work either because I don't see a cyan mesh anywhere. And I know it's not a "ghost" because I can collide with other things still.

Thanks anyway. I'm gonna keep working at it. I'm sure it's something stupidly obvious I didn't notice before...
demonicpancake
 
Posts: 6
Joined: Tue Jan 25, 2011 8:34 pm

Postby demonicpancake » Sun Feb 20, 2011 9:16 pm

What's the best way to check collision for a bullet? I want either bounding box checking or triangle checking and all I can figure out is how to check against my ellipsoid samplers with a ray.

And if I want to create a projectile that isn't hit scan, what's the best way to do that?
demonicpancake
 
Posts: 6
Joined: Tue Jan 25, 2011 8:34 pm

Postby shadowslair » Sun Feb 20, 2011 10:11 pm

demonicpancake wrote:What's the best way to check collision for a bullet? I want either bounding box checking or triangle checking and all I can figure out is how to check against my ellipsoid samplers with a ray.
I`m afraid at the moment you cannot raycheck against your coll entities` triangles or bboxes the way Irrlicht does in the 07.Collision example. Of course at least for the ray-aabbox you can easily make it yourself.

demonicpancake wrote:And if I want to create a projectile that isn't hit scan, what's the best way to do that?
Not really sure what you mean, but you can create a projectile and use coll entity for it- say a sphere. If the projectile is a rocket for example and you don`t want it to be affected by gravity, easiest way to do it is to call myRocketProjectileEntity->resetGravity(); manually each step.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby demonicpancake » Tue Feb 22, 2011 6:54 pm

I`m afraid at the moment you cannot raycheck against your coll entities` triangles or bboxes the way Irrlicht does in the 07.Collision example. Of course at least for the ray-aabbox you can easily make it yourself.


And how exactly would you do that? Sorry, I'm a noob.

Not really sure what you mean, but you can create a projectile and use coll entity for it- say a sphere. If the projectile is a rocket for example and you don`t want it to be affected by gravity, easiest way to do it is to call myRocketProjectileEntity->resetGravity(); manually each step.


I tried to use a coll entity for it but it would collide with the player when it was shot. Then it would like jump on top of the player and go from there. Perhaps a better question is, is there any way to prevent certain objects from colliding with each other?
demonicpancake
 
Posts: 6
Joined: Tue Jan 25, 2011 8:34 pm

Postby shadowslair » Wed Feb 23, 2011 12:02 am

For the ray-box check I advise you to google it a bit or if you`re really lazy or cannot find anything, you can always take a look at the irr source in "void CSceneCollisionManager::getPickedNodeBB(bla-bla)". It`s a bit messy at first look, but it works and is a ray-obb check.

About the projectile problem- probably the best way would be to add collision groups and before the broad phase you check whether an entity can collide with another one and if it cannot, to skip it or sth similar.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby VeTaL » Wed Feb 23, 2011 11:59 pm

Hi, guys... Looking like the link is broken :?
VeTaL
 
Posts: 14
Joined: Mon Feb 21, 2011 8:39 am

Postby shadowslair » Thu Feb 24, 2011 2:58 pm

Hi, VeTaL. Here`s a new link: http://www.mediafire.com/?gp3pb5uiaz3776c
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby VeTaL » Thu Feb 24, 2011 3:21 pm

Thanks for fast reply :)
VeTaL
 
Posts: 14
Joined: Mon Feb 21, 2011 8:39 am

Postby Dareltibus » Thu Mar 10, 2011 9:22 am

the link is broken :(
User avatar
Dareltibus
 
Posts: 115
Joined: Mon May 17, 2010 7:42 am

Postby shadowslair » Thu Mar 10, 2011 1:04 pm

Dareltibus wrote:the link is broken :(

You`re too fast to post, and not reading enough. The initial is dead, but the one I posted should work fine.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest