Jump to content

How to create custom physics?


Syle Devin
 Share

You are about to reply to a thread that has been inactive for 3874 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So I am working on a build and I tried to create my own physics mesh. While I created the mesh and uploaded it.

bowling lane physics.png

 

Instead of the bounding box acting as I set it up it ends up as a giant cube that I cannot walk into. What setting do I need to set the physics mesh to so that it works as I made it and not just a cube? Any help is appreciated.

Link to comment
Share on other sites

Yes I looked and it is set to convex hull. I think it has to do with the settings I set the physics model to or the physics model itself. I know in the upload the physics model it shows does not look the same as the one in blender. I head something about only using cubes for the physics model? I used a cube that I streched and such, maybe it is taking that as one object instead of a complicated object.

Link to comment
Share on other sites

If the physics model is successfully uploaded with your mesh, you should have the option to set the physics from "convex hull" to "prim" in the features tab. I have no idea why LL decided so or overlooked the fact the shape always defaults to convex hull. Anyway, if you don't have the option, the physics model wasn't uploaded.

The model should look the same as in Blender in your upload window. Maybe you didn't save the entire model as dae? Did you also hit "analyze" in the uploader? That seems to be mandatory the last couple of viewers for a correct upload. If this doesn't help, can you tell us how the physics model looks in the uploader?

EDIT...forget about the mandatory analyze and read Drongles post below instead...

Link to comment
Share on other sites

 You need the physics shape type to be Prim, not Convex Hull. You can never go inside a convex hull, by definition.

Note that the physics weight given in the uploader is that for the convex hull, and that the Prim type weight might be quite different. The only way to tell, at least for now, is to upload and see. It will also depend on whether you use a decomposed shape (pressed the Analyse button) or a triangle based shape. Where the triangles are large, as in your shape, the undecomposed, triangle-based shape can be lower weight.

The decomposition function makes your physics shape into a set of convex hulls (although you still set type Prim to use it). If you do decompose (Analyze), you can often guide the decomposition function to make more appropriate decisions by making your physics shape of non-overlapping parts that are already convex hulls instead of shapes that have concavities. So, for example, make the U shaped wall out of three separated box shapes. It will then be less likely to fill in spaces as you increase the simplification.

Finally, curves are expensive for both triangle-based and decomposed shapes, as well as for the default convex hull for the whole object. You have already dealt with that, but I include it just for completeness.

The stuff you heard about cuibes was probably in connection with the use of invisible linked prims as the physics shape (setting the mesh to type None). In that case, there is a big physics weight advantage. For uploaded physics shapes this advantage does not apply.

========================================

This looks like the physics shape for the visual mesh you showed earlier, but as part of a much larger mesh. If the visual mesh is now also that much larger, then the size- and distance-related comments I made about it will no longer be valid. This would probably be large enough that the low LOD doesn't count in the download weight calculation (radius>10.86m), and the high LOD becomes more significant. That makes it harder to control the download weight by optimising the lower LODs. If this is a concern, you might like to consider keeping the build as an assembly of smaller meshes.

Link to comment
Share on other sites

"Did you also hit "analyze" in the uploader? That seems to be mandatory the last couple of viewers for a correct upload."

I hope that isn't accurate. That would ruin mesh landscapes. What viewers did you think that was happening with? I just uploaded an undecomposed shape with Second Life 3.2.9 (248932) Feb  6 2012 12:15:41 (Second Life Beta Viewer), and it was fine. Maybe there is a bug with some files/shapes. Should we investigate that?

Link to comment
Share on other sites

I haven't been very busy building lately and really only had the issue with one type of object, a set of roads. No matter how many times I tried and in how many ways, without hitting analyze the object would act like a hull, even though the physics shape (shown through the dev menu) was correct. After reading your previous post and going by the fact I didn't have the issue earlier, I think it's just my type of object, not what I suspected earlier..I DID say "seems to" :)

If I run into the issue with other items it might be something to look into. For now I think that would be a waste of time and efford.

Link to comment
Share on other sites

Thanks for that, I will test it out and report back. I dont think I did decompose before I uploaded but I will see. I know I just had it use the the file as the physics mesh and I didn't do any of the other steps since I didn't know I needed to. Also I checked and the physics mesh looks exactly as it should now in the uploader. I can't upload it right now but I will be able to later and see if it will turn out properly this time.

 

To say also, since you saw the model I posted, I understand what you mean about the low lod. The model is so big and already pretty low lod for the size that there isn't so much to be cut. I'll have to get really creative on that. Though if I let second life calculate it out I can get it down to about 40 land weight, thoughts its 140 if I have all the LoD levels set to use the same as high. I am not worried just yet since I have it all set to high for the purpose of looking at it and I will not set the final product to all high. All chopping and gerating of high to low LoD will be done once my model is done, which it isn't. Though now, after looking at the build, I am thinking about taking your advice and chopping it down more in the end. I will test with that also to see what I can do. I would rather keep the room only a few meshes and not have to chop the wall sections up.

Link to comment
Share on other sites

"There was no option to set it to prim"

That's what happens when you don't make a physics shape. You are stuck with the default convex hull. To make a physics shape, you must select one of the options on the physics tab, and if you choose "From file" you must provide a valid dae file. Otherwise there will be no uploaded physics shape and the Prim type that selects it will be absent. If you did use a LOD mesh or specify a valid file, and it's still not there, that indicates some other kind of error, possibly a bug.

Link to comment
Share on other sites

Ah, yes I made sure the physics shape was set to "load from file" and that the file I chose was a valid .dae. It still doesn't work. Though I wonder that I may need to resave my physics mesh as a new .dae because I already uploaded it. I found out, the hard way after I crashed a couple of times, that I couldn't upload the same .dae mesh file. I had to resave as a new .dae file. It may be the same way for my physics mesh and I will try again.  I will try again I guess sinc eit seem like it is some kind of bug.

Link to comment
Share on other sites

Could be the slm file. I have that turned off permanently. You can do that by Advanced->Show Debug settings, then typing in MeshImportUseSLM and setting it to FALSE. To avoid it for one occasion, just delete the .slm file that is in the same directory as the .dae file. It causes all sorts of problems, and just saves a little typing and clicking. So I would disable it permanently.

Link to comment
Share on other sites

"what does the slm file even do?"

I'm not sure of the exact details, as I don't use it, but generally it is supposed to store a lot of the information you enter into the upload dialog tabs. If it's there, then when you upload a dae file with the same name, it will fill in those parts of the dialog automatically. I think that is meant to make it easier to upload with unchanged settings after minor adjustments. However, it is too easy for changes to be incompatible with the previous settings and cause errors, and generally I find the time spent doing the upload is negligible compared with the time making the changes and testing. So I disabled it. Others may well find it more useful. I suppose that if you use a versioned filename when you made changes, you would avoid the problems and would then be able to step back easily and accurately to upload previous versions. That might be very useful, but I am too undisciplined for that.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3874 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...