I’m hoping someone can point me in the right direction here. I’m currently using the following code for the rotation of an entity with a mouse in my app:
Pulse1.prototype.onMouseMove = function (event) {
if (this.factor > 0) {
var mouse = this.app.mouse;
if (mouse.isPressed(pc.MOUSEBUTTON_LEFT)) {
this.rotate(event.dx2, event.dy2);
}
This works great and I’m able to rotate the entity freely.
What I am trying to do now is set rotation limits for both the x & y axes (i.e., -30 degrees to +30 degrees). If someone could offer a example of code for this or point me to a good reference, the help would be greatly appreciated. Thanks!