Physics problem

Blitz3D Forums/Blitz3D Beginners Area/Physics problem

Mido486,

What you need to do ( I thought it was well known by now ) is store the pointer integer of the type instance in the entityies name.

e.g.


m.Mass = new Mass
m\Msh = createsphere()
NameEntity m\Msh, Handle( m ) 



Then when you get the entity involved in the collision you can do this to retreive the Type instance ..

entity = EntityCollided (m\Msh,ID)
If entity <> 0
  c.Mass = Object.Mass( EntityName( entity ) )
  c\vx = blah
  c\vz = blah
endif						


For a working example - see 'A Wee Tank Game' in the code archives.

Hope this helps.

Stevie