its easy to set a body to be a sensor with:
but what if you already have a body and you want to set it to be a sensor?
should I do something like?
no such command exists.. or anything simlar to it...
Code:
var theShapeDef:b2PolygonDef = new b2PolygonDef();
//.. some other theShapeDef arguments go here...
theShapeDef.isSensor = true; // <<< SET TO SENSOR
var theBodyDef:b2BodyDef = new b2BodyDef();
theBodyDef.position.Set(X, Y);
var theBody:b2Body = world.CreateBody(theBodyDef);
theBody.CreateShape(theShapeDef);
theBody.SetMassFromShapes();
//.. some other theShapeDef arguments go here...
theShapeDef.isSensor = true; // <<< SET TO SENSOR
var theBodyDef:b2BodyDef = new b2BodyDef();
theBodyDef.position.Set(X, Y);
var theBody:b2Body = world.CreateBody(theBodyDef);
theBody.CreateShape(theShapeDef);
theBody.SetMassFromShapes();
but what if you already have a body and you want to set it to be a sensor?
should I do something like?
Code:
theBody.SetAsSensor(true); // THIS FUNCTION DOES NOT EXIST
no such command exists.. or anything simlar to it...