Jump to content


Photo

Precise 3D Collisions Dll (P3DC.dll) V6.1


  • Please log in to reply
375 replies to this topic

#361 Ciberman

Ciberman

    GMC Member

  • New Member
  • 5 posts

Posted 02 June 2012 - 05:20 PM

ok.. does anyone know how to fix example 5 in p3dc version 6.1? because it doesnt work since p3dc_set_modrot() and i can not figure out how to use it... thanks


I have the same problem, can anyone reply? Can brett14 reply?
  • 0

#362 GamePro

GamePro

    GMC Member

  • GMC Member
  • 230 posts

Posted 09 June 2012 - 08:32 PM

Quick question: for p3dc_split_model() to work, does the entire model (in the file itself) have to be in the quadrant with positive x's and y's? I ask this because the model is currently centered at (0,0,0) and collisions only work with a fraction of the faces unless I play around with the arguments of the function for a while...

EDIT: Okay, just found out after testing, the answer is yes. You might want to mention that in the script, brett14; not only should the origin be (0,0,0), but the model should only be "positive".

Edited by GamePro, 09 June 2012 - 08:54 PM.

  • 0

#363 Qon

Qon

    GMC Member

  • GMC Member
  • 85 posts

Posted 04 July 2012 - 02:33 PM

Why is there no example with a complex model? The one with the cones could easily have been programmed with a collision script for that shape, and you can't even reach 90% of the shapes. The (ugly colors) block world can be achieved with a block object that has 2 z values and some basic checking. What those examples shows can be achieved without linear algebra, and would probably be faster as GML.... lol If you are going to show something advanced then you need advanced models. It just axis parallel cubes and the most basic slopes possible. Jepie posted this Posted Image Which is a height map type terrain. If your engine can handle height maps then show it. This is a very basic height map. If your engine can handle enough triangles to make the ground smooth and have tunnels and bridges and things like that then show us that. And you say that the engine handles model to model collisions, but you don't even show that at all. It's simply NOT possible to notice if the collision mask model is a qube or sphere in a axis parallel environment. Is a cube the most complex model you could think of? Do a 1000 tri+ scorpion in 3rd person view or something like that. If your .dll is as qood as you say then you are showing the performance of a fighter jet in a garage -.- And btw, who needs model to model collisions? Only if you are making a game with vehicles you need it, and then you MUST be able to totate the model. For fps you want sphere (or possibly cylinder) to model collisions, it's much faster. Having a collision mask model of your character is just annoying when you get stuck because your finger is sticking out. You can only control your body as 1 single piece, so the mask should be 1 piece and as simple as possible.
  • 0

#364 waxbulletgames

waxbulletgames

    GMC Member

  • New Member
  • 25 posts

Posted 28 August 2012 - 09:47 PM

Can this use multiple objects now? I need my player to collide, my enemys to collide, and my bullets. Of course there is more than one bullet and enemy soooo. Somone please reply
  • 0

#365 Darth-Zeke

Darth-Zeke

    GMC Member

  • GMC Member
  • 10 posts

Posted 23 September 2012 - 03:50 AM

Does anyone know how to actually use p3dc_set_modrot()? There is no actual use of it in the examples and I can't find out how to change the rotation of the model for one ray cast. I tried puting it before the p3dc_ray_rotation, but that still didn't change the model's rotation.
  • 0

#366 BlueMoonProductions

BlueMoonProductions

    BlueMoonProductions

  • GMC Member
  • 241 posts
  • Version:GM:Studio

Posted 05 October 2012 - 07:47 PM

Brett14, could you explain a little about these "Accelerated Collisions"? It appears that there are two sets of scripts, one for "still" models, and one for "split" models. What exactly does splitting a model (and its collisions) do?

Or if that's too long to answer, is "splitting/accelerated collisions" usually a good thing to do?
  • 0

#367 Qon

Qon

    GMC Member

  • GMC Member
  • 85 posts

Posted 07 October 2012 - 11:01 AM

Brett14, could you explain a little about these "Accelerated Collisions"? It appears that there are two sets of scripts, one for "still" models, and one for "split" models. What exactly does splitting a model (and its collisions) do?

Or if that's too long to answer, is "splitting/accelerated collisions" usually a good thing to do?


Splitting the model is exactly what it sounds like, the model is split into several models and collision checking is only done with the model parts that are close to the player. I don't know what algorithm he uses to split the model but even if he did it in a simple way it should be many many times faster, especially for huge models. It is silly to not use the scripts that splits the model. The only reason that the the other version is there is because it is easier for the dll dev to write and because the split model scripts can use it internally to check collisions on each part.
Could also be useful if you want 1 small unit to stick together if you want to change it or similar stuff i guess, though I haven't used it.

Accelerated means that it uses less cpu time. That is good unless you want your game to lag ;)
Not splitting shouldn't even be an option :Q
  • 0

#368 BlueMoonProductions

BlueMoonProductions

    BlueMoonProductions

  • GMC Member
  • 241 posts
  • Version:GM:Studio

Posted 08 October 2012 - 07:17 PM

Thanks for the explanation.

Not splitting shouldn't even be an option :Q

I can imagine cases with very low-poly models where splitting would probably not really be an optimization .. Either way, I'll split the big stuff. Thanks again!
  • 0

#369 57E

57E

    GMC Member

  • GMC Member
  • 44 posts

Posted 13 October 2012 - 10:31 AM

Has anyone managed to get this working in gm Studio?
All the examples cause the GameMakerStudio:Runner to crash instantly at startup.
  • 0

#370 Pigdug Gaming

Pigdug Gaming

    GMC Member

  • GMC Member
  • 52 posts
  • Version:GM8

Posted 13 November 2012 - 01:14 AM

Has anyone managed to get this working in gm Studio?
All the examples cause the GameMakerStudio:Runner to crash instantly at startup.



No, it also crashes for me! i desperatly need a 3d collision dll for Game Maker: Studio
  • 0

#371 Venomous

Venomous

    GMC Member

  • GMC Member
  • 1469 posts
  • Version:GM:Studio

Posted 13 November 2012 - 02:03 AM

Adding anything to a model causes it to crash in GM: Studio. For example, this code works:
p3dc_init();
model = p3dc_begin_model();
p3dc_end_model();

but not this:
p3dc_init();
model = p3dc_begin_model();
p3dc_add_block(-1, -1, 0, 1, 1, 2);
p3dc_end_model();

I recompiled the dll to no effect.
  • 0

#372 gale4ever

gale4ever

    GMC Member

  • New Member
  • 2 posts
  • Version:GM:Studio

Posted 27 November 2012 - 11:08 AM

Adding anything to a model causes it to crash in GM: Studio. For example, this code works:

p3dc_init();
model = p3dc_begin_model();
p3dc_end_model();

but not this:
p3dc_init();
model = p3dc_begin_model();
p3dc_add_block(-1, -1, 0, 1, 1, 2);
p3dc_end_model();

I recompiled the dll to no effect.


I have the same problem :S
  • 0

#373 Fishman1175

Fishman1175

    GMC Member

  • GMC Member
  • 21 posts

Posted 28 March 2013 - 04:55 PM

First off, i would like to say that P3DC is a powerful tool.

 

This is for those that are having trouble understanding p3dc_set_modrot and p3dc_ray_rotation.

 

To solve it:

1. Make sure you have p3dc v6.1

2. Find the script p3dc_ray_rotation

3. Go to the last line and change it to this:

return external_call(global.p3dc_mrr,argument0,argument1,argument2,argument3,argument4,argument5,argument6,argument7,argument8,argument9);

 

Now the script is fixed. To use it do this:

 

 

p3dc_set_modrot(degtorad(xrotation),degtorad(yrotation),degtorad(zrotation))

//pardon my variables and crap, just do the ray rotation like you would do the p3dc_ray(). For more help look at the commented

//sections of the scripts
dist=p3dc_ray_rotation(global.box_collision,x,y,0,player1.x,player1.y,player1.z,mx,my,mz)

 

if dist<100000

{

//do stuff because it was hit

}

 

I hope this helps people, it took me a long time to figure out why the script wasn't working.


  • 0

#374 UKDutyPaid

UKDutyPaid

    GMC Member

  • GMC Member
  • 183 posts

Posted 30 March 2013 - 10:32 PM

First off, i would like to say that P3DC is a powerful tool.

 

This is for those that are having trouble understanding p3dc_set_modrot and p3dc_ray_rotation.

 

<snip>awesomeness<snip>

 

I hope this helps people, it took me a long time to figure out why the script wasn't working.

Thank you!  Man, you don't know how long that's been bugging me, P3DC is so much more efficient than my homemade concoction, and now I can use it for what I want it... finally.

 

Cheers Fishman!

 

and thanks Brett!


  • 0

#375 Venomous

Venomous

    GMC Member

  • GMC Member
  • 1469 posts
  • Version:GM:Studio

Posted 30 March 2013 - 10:46 PM

Did anyone get this working with Studio yet?

 

Edit: Changing all the dll function call types from dll_stdcall to dll_cdecl makes this dll work in Studio.


Edited by Venomous, 08 April 2013 - 10:58 PM.

  • 0

#376 Firgof

Firgof

    GMC Member

  • GMC Member
  • 45 posts

Posted 19 May 2013 - 05:33 PM

Doesn't make it work for me.  The very first line errors out.

global.p3dc_bdm = external_define(n,"bdm",dll_cdecl,ty_real,0);

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users