Haydenmango Posted May 19, 2014 Share Posted May 19, 2014 When you throw a small entity (with rigidbody physics, above 0 mass, swept collision mode on or off, and a generated or convex hull physics shape) the entity will sometimes fall right through the ground (whether the ground is a imported model, terrain, or BSP box). The throwing script I use is a slightly modified version of the FPSplayer.lua script. I made a video to help show the problem. https://www.youtube.com/watch?v=NYBlJxsM04k Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Admin Posted May 19, 2014 Share Posted May 19, 2014 Try enabling swept collision for small objects like that. Link to comment Share on other sites More sharing options...
Haydenmango Posted May 19, 2014 Author Share Posted May 19, 2014 I did, check out the video. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Admin Posted May 19, 2014 Share Posted May 19, 2014 Yep. Link to comment Share on other sites More sharing options...
Josh Posted May 19, 2014 Share Posted May 19, 2014 In this example, you can see it's working in a pretty extreme situation. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetsweptcollisionmode-r147 Try calling this in app.lua: self.world:SetPhysicsDetail(mode) Where "mode" is the following: 0: Exact (shouldn't really use this but try it for testing) 1: Default 2: two iterations 3: three iterations 4: four iterations 5: ... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Haydenmango Posted May 19, 2014 Author Share Posted May 19, 2014 Yeah that is werid because that example is way more extreme than mine. What is even more weird is that entities still go through the ground in my example even with SetPhysicsDetail() set to exact(0)! I even made a completely new map with SetPhysicsDetail(0) in the App start and then I made a script that turns on SweptCollisionMode and added it to a couple entities with varying masses(.5,1,and 3). The model the entities used was the small crate model from the tutorial maps. I also changed the throw force in the FPSPlayer.lua script to 2000*entity:GetMass(). So far I haven't seen an entity with a mass of 3 fall through the floor but entities with a mass of .5 or 1 almost always fall through the floor. --i take this back after making the throw force 2000*entity:GetMass() every single object I throw eventually falls through the ground no matter the mass. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Admin Posted May 19, 2014 Share Posted May 19, 2014 It might be that terrain is somewhat less accurate because it has no volume. The best approach is to probably not throw objects quite as fast, and try to make them a bit bigger if possible. I know this will happen with all the physics libraries out there. Link to comment Share on other sites More sharing options...
DerRidda Posted May 19, 2014 Share Posted May 19, 2014 Could be problematic if you were trying to use the physics engine for bullet ballistics. Link to comment Share on other sites More sharing options...
Admin Posted May 19, 2014 Share Posted May 19, 2014 Could be problematic if you were trying to use the physics engine for bullet ballistics. Use ray casts for this! 1 Link to comment Share on other sites More sharing options...
catch22 Posted May 19, 2014 Share Posted May 19, 2014 This happens with all physics libraries. I have limited exposure to most of them (especially in the past few years), but Box2d, if I recall, casts a ray along the trajectory to see if it will collide with a surface (despite depth) at any point along the path, and step a collision response if there is indeed a very small object in its path, regardless of speed. You could try to make your "floor" polygon deeper to alleviate it. For what it's worth, this just happened to me with a baseball bat I modeled and was throwing around last night, but I didn't address it since I was just playing around. Coding for Christ. Link to comment Share on other sites More sharing options...
Haydenmango Posted May 20, 2014 Author Share Posted May 20, 2014 Hmm I may have to scratch my game idea if this is the case.... most of the combat in my game was based around throwing objects at enemies. The log you see in the example video was going to be the slowest and probably one of the bigger thrown weapons. Hmmm I just had an interesting thought though.... What if I scaled everything up a good amount so that the objects still look small but are actually pretty big??? hmmmmmm... Thank you for the responses! Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Josh Posted May 20, 2014 Share Posted May 20, 2014 I would just make your log a little bit bigger. A cylinder shape also might be more accurate, using the cylinder setting in the physics properties. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Haydenmango Posted May 20, 2014 Author Share Posted May 20, 2014 I could do that but the thing is the log is the least of my worries. I have much smaller models (rocks,food,etc.) that I have to account for as well so it seems everything just needs to be bigger. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Shadoh Posted May 25, 2014 Share Posted May 25, 2014 may I suggest that you make it switch off 'normal' collisions when velocity is high, in favor for checking with raycasting, and doing a custom physics for it (you can make your own drag dynamics and stuff then), then when the velocity is low, switch back to normal physics 1 Link to comment Share on other sites More sharing options...
Haydenmango Posted May 26, 2014 Author Share Posted May 26, 2014 Good idea. I may make an attempt at that as I still am having this issue. Scaling everything up didn't work because Character Controller physics wouldn't scale with everything else. Scaling up the throwing objects didn't solve the issue either. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
catch22 Posted May 28, 2014 Share Posted May 28, 2014 what's the problem with making the ground deeper? If you're using a simple plane, without raycasts, everything will eventually fall through it. Probably despite extreme speed or not. You'd be scanning for an intersection of no depth, lol. A slower computer this will happen almost all the time on. Coding for Christ. Link to comment Share on other sites More sharing options...
Einlander Posted May 28, 2014 Share Posted May 28, 2014 You might have a multistory building/platform where floor depth matters or is visible. Floor depth of .5 you can get away with, but when you start climbing stairs, you'll notice how thick a floor is. Link to comment Share on other sites More sharing options...
Haydenmango Posted May 28, 2014 Author Share Posted May 28, 2014 I started having this issue before I even used a terrain. I had a giant BSP box for the ground and things still fell through. No matter how thick the box was entities would still fall through. It did happen less often then it does when I am using terrain but it still happens nonetheless. Also I am using leadwerks terrain and I don't think there is a way to just thicken the terrain. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
catch22 Posted May 28, 2014 Share Posted May 28, 2014 Huh, that's strange. Sounds like a bug with the swept collision, then? Granted you aren't doing something strange in your own scripts that would override collision (like setting position yourself, in some fashion, post collision response). Also, that your physics shapes are indeed accurate. Coding for Christ. Link to comment Share on other sites More sharing options...
macklebee Posted May 31, 2014 Share Posted May 31, 2014 this used to be a common thing in LE2 with certain convex shapes at certain angles or with really small items, but working with julio at the time with test programs he was able to resolve this issue... granted this was using newton version 2-something or other... unfortunately it looks like its resurfaced again... example vid of after it was resolved in the earlier newton dll 1 Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
DerRidda Posted August 29, 2014 Share Posted August 29, 2014 I added some very small objects to my scene and they were falling through the scene if I so much as placed them a bit too high in the editor. I tried self.world:SetPhysicsDetail(0) for the exact setting but that didn't help. I then tried out self.world:SetPhysicsDetail(20) and that did the trick. So if anyone is still suffering from this issue, exact isn't the end all, be all. Link to comment Share on other sites More sharing options...
Josh Posted September 5, 2014 Share Posted September 5, 2014 I believe you may have better behavior in the next update. Please let me know if you notice a difference. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted September 12, 2014 Share Posted September 12, 2014 This was indeed a bug in Newton and is indeed now fixed. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts