this is a copy from another question, I try to modified it to rotate on the y axes--not so much for a 3d view, but as a flip, like a card, or a page-- but I can't seem to figure it out, I triad the api reference and documentation, but it's mostly like w3c for the reference section--even know, w3c give some code explanation on how it'll look in productivity--.
How to rotate period. What do I use? state? or Phsyics.transform.rotoate? And if so, how?
// create a behavior to handle pin constraints
Physics.behavior('pin-constraints', function( parent ){
return {
init: function( opts ){
parent.init.call( this, opts );
this.pins = [];
},
add: function( body, targetPos ){
this.pins.push({
body: body,
//wouldn't this be change to Physics.vector.prototype.rotate( targetPos )
target: Physics.vector( targetPos )
});
},
behave: function( data ){
var pins = this.pins
,pin
;
for (var i = 0, l = pins.length; i < l; i++){
pin = pins[ i ];
// wouldn't this chagne to pin.body.state.angular.pos
pin.body.state.pos.clone( pin.target );
}
}
};
});
this is for a question for PhysicsJS user and creator.... --I was instructed to post here if I have questions--