Materials object vs material ID

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Materials object vs material ID

Postby tshannon » Thu Oct 11, 2012 10:32 am

I'm having trouble wrapping my head around the difference between a material ID and a material object. Is a NewtonMaterial an object that defines the interaction between two material IDs?

My main issue is that fact that in my Go bindings I'm using the userData associated with the other types (Body, World, Joint) to manage the pointers to the Go object that embodies that C Newton type. With NewtonBody, NewtonWorld, and NewtonJoint, I can get and set the user data on a give object. With materials, you seem to set the userdata on a pair of material id's, but you get the userData from a NewtonMaterial object.

What's the relationship between the two?
tshannon
 
Posts: 22
Joined: Wed Sep 05, 2012 3:21 pm

Re: Materials object vs material ID

Postby Julio Jerez » Thu Oct 11, 2012 11:30 am

The material system is a graph of node and edges. NewtonMaterial are the nodes and they represents properties of real materal like concrete, wood, metal etc, they are eh material IDs that you asign to a body.
the edges are the relation between material, for example metal interact different with wood than with concrete, that relation is what the set when you design the comnection of the material graph using the material interface
It can be confusing, there are simpler schemes of material that do not use pairwide interation, maybe that will be simpler for you
look at this tutorial, http://newtondynamics.com/wiki/index.ph ... ial_System
it makes a material system that uses one call back.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron