While editing the location and rotation of objects, allow transforms based on a "reference" object or alternate grid.
This would also facilitate the use of measurements other than metric such as imperial dimensions.
While editing the location and rotation of objects, allow transforms based on a "reference" object or alternate grid.
This would also facilitate the use of measurements other than metric such as imperial dimensions.
Hi Ethos, we will look into this feature request!
Can one object (e.g., a door) detect the position of another object (e.g., a door frame) and use it to do this calculation? If so, do you mind pasting some sample code here to show how? Thanks.
I've been looking for a place to put this, PLEASE always use the metric system as much as possible.
If you've ever taken physics you know how much better it is.
The internals all work on metric so best to stick with it.
Sure you can do conversions, but why when you don't have to.
Galen, Your thoughts are related to scripting while my original post related to editing and positioning while we build. And I too appreciate your question. The scripting of doors is a vital link to a believable interaction with a house or any other building or portal.
Gindipple, I simply do not know how the physics engine uses the numbers associated with an object's geometry. When I make an object and upload it into Sansar, there is no way to know that the object's dimensions are stored in either metric or Imperial units. A door that is three feet wide is less than one meter. But we do not really know that the engine thinks is "3" or "<1" when it does math.
My avatar is 5'-11" tall. But the physics engine has a physics mesh that it uses for collisions with my avatar that is 6'-6". We do not know if the physics engine saves, uses, and finally calculates with 6ft+6inches; or if it uses 78 inches, or if it uses 1.9812000000000003 meters. When we know that answer, we will have a better understanding whether we should expect the software and the server to convert our upload dimensions or if the software and the server can reasonably expect us humans to do those calculations for it.
As with the seminal reason we built computers in the first place, we humans should be allowed to expect the computer to do the math for us. We just do not know if the authors of the Havoc engine agree with us.
Ah, I did not get that context on my first read. Pardon my confusion. Makes sense now.
Does Sansar offer linking of objects into larger ones in the SL sense? It sounds a little like a solution to what you may be describing.
@Galen, we are all looking forward to being able to link objects in Sansar as well as importing multiple objects that are all in the same group. I suggest that you may want to start your own post that addresses your scripting question. I expect that you will get a direct reply from someone on the Sansar team.
I really messed up in my first comment directed to Gindipple about how a computer does math and stores numbers. It is quite simple and I trust you will all agree. Math is done on Hexadecimal numbers inside the processor. Those numbers have no understanding if you meant them to be Metric or Imperial (Feet and Inches). When I model in Blender and use units that are feet or inches the FBX file that Blender creates stores those values in Hexadecimal and transfers the value to Sansar in Hexadecimal. There are no feet and inches or meters and centimeters. Then, Sansar used both the rendering engine and the Havoc physics engine to work with those Hex values and it does not decide on the merits of metric or Imperial. It simply does the calculations needed to display and move objects. Once you see it on your screen or in your VR headset your mind makes an evaluation of the visual appearance. Now that it has become virtual, nobody will ever know or care what units you used to create your models. And, the computer certainly does not care what the values are of the hexadecimal numbers it stores and calculates. Of course there is a basic range of values that have been established by the Sansar team to keep the servers somewhat efficient for the Havoc engine. I could give those number in Feet and Inches OR I could give those numbers in Meters.... Or I could speak the language of the computer and give you those numbers in Hex. But the end result will be an image on the screen, and not a foot or a meter.
Here's the thing, let's say you build an intricate device, maybe it has gears in it, moving parts, things that have mass and depend on it being as real as possible. And now you hand it off to a programmer to make it all work. That programmer is going to be a lot more happy if you're measurements are in meters since that's what the Engine layer uses for real physics. There's an actual Linden's comment over in one of the modeling docs about preferring to use metric.And inside blender you can set it to use metric. Again, sure you can do conversions, I'm just suggesting if at all possible prefer to use metric system. It is far superior to the Imperial system.
If it wasn't for gallons of milk or gallons of gasoline we would have switched along time ago.
It's an utter achievement the soda industry pulled off the 2-liter bottle.
Baby steps I guess
Example code:
Vector Force = RigidBody.GetMass() * RigidBody.GetLinearAcceleration();
vs.
Vector Force = ConvertToImperialMass(RigidBody.GetMass()) * ConvertToImperialAcceleration(RigidBody.GetLinearAcceleration());
Gindipple,
I am enjoying this dialog. We may learn more than is currently known. But, here is what is known. The programmer you speak of will receive the data you hand to him. In my case it is both me and me. I will receive what I give me.
Now I do not believe that the programmer will ever see the engine layer. Again, all units that are visible to us in the properties interface do not have units. They only have a value. Density has a range of values from 1 to 10,000 There are no units. Friction has a range of values from 0.0 to 1.0 - Again, no units. If units mattered then the Sansar team would have made them appear in the properties. Bounce has a value of 0.0 to 1.0. Again, Sansar has not shown us any units and I suspect they are arbitrary. Very few Sansarians will ever want to know or be able to use a bounce unit.
And I believe that I saw the Linden comment about modeling, and I also believe it had no basis. So, I asked them to rewrite it to say to model in real world dimensions of either Metric or Imperial which they did. Now I cannot find that text myself. The important thing is that if you want an object to appear in this virtual world, make it the size of the Real World object.
And, regarding code for scripting, once we get the mass, we really do not care what it is. Only humans care about such things. To a computer, it is all Hex. You might be the only scripter using C# in Sansar that will ever write code that uses real-scale values of mass and velocity. I spent ten+ years trying to get LL to allow us to walk at 0.75 Meters per Second in Second Life. And the fact that I wrote it in Metric units rather than Imperial units did not change the outcome. It just never happened.
We are not doing physics in Sansar where the values matter. All we want is for things to appear sorta believable. Our brain has adapted to judge by appearance not by measurement. We will never sell or buy a gallon of milk. We will never drink beer or feel full from having a pint of beer in Sansar. We are creating shapes and volumes to sorta look like things we know from real live. The physics engine may care about scripted values they run into in a C# script. But the modeling engine does not.
And, when it comes to gears, let me know when your engineer can make one gear turn another gear by passing metric units to the script. The current rotation scripts do not use units. Only values.