badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 14 Jun 2014 05:20 PM |
Is it possible? With all of the cloth physics (capes etc), they don't seem to collide with normal bricks, only players
u wot tifany? (ง ͠° ͟ل͜ ͡°)ง ill gnaw ur arm off hagrid! |
|
|
| Report Abuse |
|
|
| 14 Jun 2014 06:16 PM |
Yes. You can use getPartsInRegion3 as a broadphase and then push the cloth vertices out of any blocks they are inside. Would let you make a rly long cape and drag it along the ground o3o
eg. 10*50 cape is 500 bricks (assuming bricks are at vertices and not between them for simplicity) and 500 vertices
Assuming CFraming all of those is not too laggy, you need 500*actualBricks checks to do collisions with environment.
Lua should handle that just fine, you could refine environment bricks down to like under 10 most of the time (ground, big objects nearby)
Then clamp the vertex vector3 positions outside the bricks (simple vector maths). The forces should be solved BEFORE that step so at the end all vertices are outside bricks.
I assume you dont apply any forces to the vertices from environment tho, i dont know if it looks bad without doing that.
You could optimize the cape by doing it row by row and merging bricks that are in nearly the same line, which is true for most of the cape bricks. |
|
|
| Report Abuse |
|