I looked into the following code in the Hotspot example.
I dont understand where
for example
this.hitArea
etc come from.
They are not defined in code and I couldn’t find them in the api reference as welll
What am I missing ?
Hotspot.prototype.initialize = function() {
// Create a hit area using a bounding sphere
this.hitArea = new pc.BoundingSphere(this.entity.getPosition(), this.radius);
// More information about pc.ray: http://developer.playcanvas.com/en/api/pc.Ray.html
this.ray = new pc.Ray();
this.defaultForwardDirection = this.entity.forward.clone();
this.directionToCamera = new pc.Vec3();
this.sprite = this.entity.children[0];
// Register the mouse down and touch start event so we know when the user has clicked
this.app.mouse.on(pc.EVENT_MOUSEDOWN, this.onMouseDown, this);
if (this.app.touch) {
this.app.touch.on(pc.EVENT_TOUCHSTART, this.onTouchStart, this);
}
};