Unity plugin progress?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Unity plugin progress?

Postby Sweenie » Sun Feb 12, 2017 6:06 pm

JoeJ wrote:
Sweenie wrote:By the way, i've checked in another scene. I connected 10 boxes with the actuator. It looks so awesome. :mrgreen:


I'm glad the days of manual tests coding are almost over :D


Haha, yeah. It's much more fun with an editor. :D
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Unity plugin progress?

Postby Julio Jerez » Sun Feb 12, 2017 7:03 pm

hey joe can you play the plug in?

Sweeney I edited the actuator rig to make it more dramatic, you can see that the behavior in the original you tube video is not quite correct, it way more solid than Physx but physically incorrect.

each time you have an object moving on a rotation frame there is a Coriolis effect that push the object sideway generation an back latch force, that do not seem to be reproduced in their video, or a least does not seems to. His rods all spins smooth as if they were not moving on a non rotating frame, this is typical behavior of impulse based engines.
Newton has not problem reproducing that behavior quite easily.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Julio Jerez » Sun Feb 12, 2017 7:10 pm

I can not make a video using Frap, but is seem that is you publish the demo them is possible,
however when I public the demo does not start.
what do we need to do to make start when the game is published.

Is time to start making videos so that we can spark interest among potential users. maybe we can get ideas and suggestions.

Now I will add the relational joints, as the second test case for how to add functionality.
Relational joints allow for really cool effects.
I will start with the gear.
then next week I will continue with the vehicle and rag doll manager.

at that point the p[lug in will be in a good shape. because anybody can extend anyway the wish by simply adding the header file to the swig script.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Julio Jerez » Sun Feb 12, 2017 7:18 pm

JoeJ wrote:I'm glad the days of manual tests coding are almost over :D


I absolutely agree, :mrgreen:
is almost that you want to use Unity the development platform end.
the cool thing is that the engine has a serialization that can export both binary and xml scenes.

so we can export scenes for the users that do not use unity.
It's a long time I do not check the XML exporter, but is a matter of bringing up to date and move to a more data driven system.
I wanted to do this long time with blender, by blender is too hard for me.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Julio Jerez » Sun Feb 12, 2017 9:46 pm

we now have gears. :shock:
next I will add the two axis way gear which is important for sophisticated and interesting mechanical articulations. :twisted:

do you guys think we should remove the min and max limit from actuators and leave them up to the script, I think they are in the way of controlling the target angle from a user script.
I find that is making scripting harder because it need to check is the desired target is within the joints limits and that seems unnecessary.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Sweenie » Mon Feb 13, 2017 3:20 am

I can not make a video using Frap, but is seem that is you publish the demo them is possible,
however when I public the demo does not start.
what do we need to do to make start when the game is published.


I just tried publishing the actuator scene as a standalone demo and it seems to work fine.
Under the build settings, did you change the architecture to x86_64?
Maybe your published demo tried to run as a 32-bit application.

Please try this and see if the demo runs on your computers...
http://www.svenberra.net/NewtonActuatorDemo.zip

[EDIT]

Oooh, we need to add the SliderActuator as well.
I got a sudden urge to create a robot picking up and moving stuff. :D
Back in school we had a project involving a robot doing that, but I was assigned to a stupid station where a pneumatic cylinder picked up marbles with vacuum. I was so envious of the guys who got assigned to the robot moving wooden blocks. :evil:

Still got a B+ in robot programming, though i didn't even got to touch the robot... :roll:
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Unity plugin progress?

Postby Sweenie » Mon Feb 13, 2017 8:16 am

Added a simple robot scene with three controllable actuators.
Had to expose SetSleepState to wake the body up.

Maybe a better idea would be to wake the body when SetTargetAngle is called instead.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Unity plugin progress?

Postby Julio Jerez » Mon Feb 13, 2017 8:58 am

oh yes the problem was that I did not change to x64
here is our first video


on the robot, yes of course, now is your change to make a full robot and get an A+ and you show them :D.

last night I was torn between doing the sliders or the universal joint first, so I decided for the universal first so that we can make little wheel robot that move and steer with proper by torque.
I mean realistic simulations with realistic part that are plausible to find.
we can simulator gripper, differential, and other things.

I expect that as we make more elaborated demos we will need to add functionality that is difficult to foresee now. But yes of course we will ad all the basic joints.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Julio Jerez » Mon Feb 13, 2017 9:52 am

I added the universal joint now.
I think there is still something wrong, either on the unity part of in the plug in.

when I we draw the gizmo, the orientation of the pin matrix is set by default as a identity
(a vector (0, 0, 0))

but when the pin is displayed, the direction points opposite to the axis, and should be the same.

now since this is all on unity side, I say that that the draw function is wrong, but that does no make sense to me. It is import that we do not get inconsistencies with coordinates, we need to resolve this small issues before going forward because late they become part of the system.

on this.
[quote]Maybe a better idea would be to wake the body when SetTargetAngle is called instead./quote]
yes I think that will resolve the problem.
The last thing we want to is wake up bodies in an update and have the scene alive perpetually, we need to do intelligently on demand.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Julio Jerez » Mon Feb 13, 2017 10:13 am

never mind, it was the gizmo display function that was wrong using drawline instead of drawray.
it is all good now.
we got universal joint now, we are close to make our first driving rigid body robot. :shock:
for that we nee the universal actuator, and differential gear.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Julio Jerez » Mon Feb 13, 2017 10:24 am

hey the robot is really cool, considering the limited resource we have at this time.

you already have a far more advanced robot that what Microsoft has done with PhysX as core simulator.
They spent 15 years of research to get this:
https://www.youtube.com/watch?v=O54c1eex1dU
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Sweenie » Mon Feb 13, 2017 10:40 am

Julio Jerez wrote:hey the robot is really cool, considering the limited resource we have at this time.

you already have a far more advanced robot that what Microsoft has done with PhysX as core simulator.
They spent 15 years of research to get this:
https://www.youtube.com/watch?v=O54c1eex1dU


hahaha, well, i can't really take the credit for that.

I realized something important that we need to solve.
Creating bodies and joints at runtime from scripts.
this code should spawn a new body and a box but the native body isn't created and causes missing reference exception.

I haven't added a mesh or meshrender component, but that isn't whats causing the problem.
Code: Select all
        var go = new GameObject("Box");
        var body = go.AddComponent<NewtonBody>();
        body.m_world = GameObject.Find("World").GetComponent<NewtonWorld>();
        body.m_mass = 1.0f;
        var collider = go.AddComponent<NewtonBoxCollider>();


I probably need to call body.InitRigidBody() but it wants a sceneIndex which I don't have.

But ideally the users shouldn't need to call InitRigidBody, the code above should be enough to create a gameobject with components.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Unity plugin progress?

Postby Julio Jerez » Mon Feb 13, 2017 11:11 am

yes I thought that would happens, because the world has a vector with a list of all bodies. we will ne to either make free list, so that we can generate and re use empty slot, of change the array to a map.

let us deal with that next weekend after will have a sufficient number of joint's implemented.
for now object can only be crated and destroyed on start and end.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Julio Jerez » Mon Feb 13, 2017 4:00 pm

what version of unity are we using.

The demo said 5.3.1 and work fine at home, but here said that the serialization was made with a newer version and refuse to parse it.
I am downloading 5.5.0 because 5.5.1 say is corrupted.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unity plugin progress?

Postby Sweenie » Mon Feb 13, 2017 4:11 pm

I'm using Unity 5.5.1f1
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 19 guests

cron