2 registered members (7th_zorro, dr_panther),
724
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: "Destructable Dirt" As in Liero
[Re: xXxGuitar511]
#179444
01/27/08 21:23
01/27/08 21:23
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
Quote:
thats just the normals, you'd need:
c_updatehull(ENTITY* ent, var frame)
"Recalculates collision hulls for the given entity to match the vertex positions of a certain frame (starting at 1 for the first frame). Call this function when you need the collision hull of a certain frame, or when you have applyied mesh manipulation functions to a frame. "
Ohh, alirght, that makes sense. I'll try this.
PS: In the mean time, and just out of curiosity. Can anybody think of any other ways to accomplish this "destructable dirt" efftect?
Last edited by Metal_Thrasher; 01/27/08 21:24.
-Johnny Thrash
|
|
|
Re: Destructable Dirt As in Liero
[Re: Scorpion]
#179449
01/29/08 03:00
01/29/08 03:00
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
...the only problem with that method is collision.
However, I guess you could also do some pixel-reading instructions to see if that area is cleared first, before moving.
xXxGuitar511 - Programmer
|
|
|
Re: Destructable Dirt As in Liero
[Re: xXxGuitar511]
#179450
01/29/08 05:47
01/29/08 05:47
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
You can do that -or- create an approximation of polygonal regions which are tested against simple collision shapes likes circles or rectangles. I shouldn't have said "polygonal" regions, because you might think I'm talking about meshes.. I talk only about a datamodel of it for calculations.
If you have this, you move your collision shape and if it intersects with an edge of a region, it collides - bingo!.. *stop moving*. To test if a shape collides you can test certain (or special) contact points per shape. This is non-trivial to beginners, because you have to basic knowledge about vector geometry and planes & lines in particular. Though, you can make a polygonal shape around your sprite and test this agains the environment shape.. then you have pixel precision.
To simplify it, DirectX has (through Lite-C) a lot of functions for this kind of stuff to quickly make a prototype... well, this is how I would try it.
I think if you google for "pixel based collision" or something like that you will get some articles, on gamedev.net (I think) there are some.
Last edited by HeelX; 01/29/08 05:48.
|
|
|
|