Ireegular shaped object collision detection

Blitz3D Forums/Blitz3D Programming/Ireegular shaped object collision detection

Link(Posted 2008) [#1]
so i made this object in AC3D that has been exported to 3DS and i put it in my game and everything , but it doesnt work. now, usually i know something about a command, but i have no clue on how to do collision detection (with an object not made in blitz3d). can anybody give me some help?


mtnhome3d(Posted 2008) [#2]
place
Const world_col=1,playr=2,enem=3,bul=4,ebul=5,pikup=6
Collisions playr,world_col,2,3
at the begining of your code
and set your objectto collide with
entitytype object,playr
then in your main loop call updateworld


Ross C(Posted 2008) [#3]
EntityType mesh,ID_Number

Collisions x,y,z,v

That's the only two commands you really need. Can you give more info about your problem? It really doesn't matter where the object is made. As long as it's not an MD2, you treat it as an entity, as you would blitz created meshes.


Link(Posted 2008) [#4]
ok, i'm making an easy to make house, just to see if i can use collision, and its an RPG so you're supposed to walk around in it, but not walk through the walls xD
anyways, im not sure what else to tell you, i just need to know how i could stop at walls and such

oh, and if you want, you can use 'camera' instead of 'player' and 'CT'(collision test) instead of 'object
txs!


Ross C(Posted 2008) [#5]
Ok, i think i know whats happening. It sounds like a mesh with lots of embedded pieces in it. If you load it as an animatedmesh, then CountChildren on the mesh.

Then, loop through and find all the children, via, FindChild(), THEN set each child with a collision mode.

Without actually having the mesh, it's hard to tell. Can you post a link to the mesh?


Link(Posted 2008) [#6]
hmmm, im n ot sure how to get it to where you can see it
since i can't give you the object, but all i need to know is how you can have collision with anything, i mean anything!
basically, what i made was 4 cylinders holding a pointed triangle top and 3 walls with one side to come in. it isnt supposed to look great, i just want to see how to do it. i doubt that what you'r talking about is happening, because i havent animated a mesh yet. just a camera and a house.
i just need to know how to collide with it and stop


Ross C(Posted 2008) [#7]
People have already posted how to do this. And an animatedmesh, doesn't mean it's animated. It means it has many parts that make up the mesh.

Load your mesh

give your mesh an EntityType number

Give your character an EntityType number

use the Collisions command to set up what you want to collide with what and collision response methods.

Call updateworld in your loop every frame.

That's all there is too it. If you look in the online manual, at the collisions command, you will see what i speak of.

email me the object

Email in my profile. Click on my name.


Link(Posted 2008) [#8]
cool, you rock man! txs!


Ross C(Posted 2008) [#9]
Did that work for you?


Link(Posted 2008) [#10]
well, almost. im not sure whats happening, but instead of colliding with it, im just doing the reponse and all times, and the only way i can move is sideays...
weird.
but,its better than nothing!