[ODE] dBodySetData

Darabos Dániel darabos.daniel at gmail.com
Tue Jun 21 05:34:06 MST 2005


Hi Mohamed!

I hope this helps:

void mysetdata( dBodyID body, int n )
{
	dBodySetData( body, (void*)n );
}
int mygetdata( dBodyID body )
{
	return (int)dBodyGetData( body );
}

Good luck,

Daniel

On 6/21/05, Mohamed Matar <Mohamed.Matar at gmx.de> wrote:
> Hi,
> I am saving my Body data as integer number like this
> 
> dBodySetData (obj[Number].body,(void*) (Number));
> 
> 
> I am trying to get the number back using dBodyGetData but it always give me
> memory error.
> I have tried several formats and failed. It is not a piece of cake for me :)
> :)
> 
> Help Please
> 
> -----Original Message-----
> From: Chunky Kibbles [mailto:chunky at icculus.org]
> Sent: Monday, June 13, 2005 1:48 AM
> To: Mohamed Matar
> Cc: ode at q12.org
> Subject: Re: [ODE] dBodySetData
> 
> On Sun, Jun 12, 2005 at 11:39:25PM -0500, Mohamed Matar wrote:
> > Hi everyone,
> > What is this function for dBodySetData. Do I need to call it after I
> > set Position, rotation, velocities and forces ?. What is the parameter
> passed.
> > Please give examples.
> 
> It's just a pointer to something. You can do whatever you want with it.
> For example, you could ignore it.
> 
> Alternatively, for an example, it might be the name of a body;
> 
> const char *name = "ABody";
> ...
> dBodySetData(body, (void *)name);
> ..
> printf("Body Name: %s\n", (const char *)dBodyGetData(body));
> 
> 
> Gary (-;
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 6/11/2005
> 
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>



More information about the ODE mailing list