-
Notifications
You must be signed in to change notification settings - Fork 0
Billiards Task Abstract Class
matthewi98 edited this page Jul 19, 2022
·
1 revision
Parent class of Pinball, Tooltask.
Setup:
- Finds gameobjects: Surface, TimerIndicator, Scoreboard.
- Subtracts surfaceTilt from cameraTilt to make JSON more intuitive (as surfaceTilt rotates everything including the camera).
- Sets whether or not the current trial is a practice trial.
SetTargetPosition
:
- Places the target using
targetAngle
andTARGET_DISTANCE
. - Angle in degrees.
- 90 degrees is straight forward, while <90 is to the left, and >90 is to the right.
SetTilt
:
- Rotates an object
obj
around an axisaxis
by angleangle
in degrees.
SetSurfaceMaterial
:
- Sets the material of the GameObject in the scene named "Surface" to
material
.
CalculateScore
:
- Calculates score based on distance to target.
- Returns a float between 0-1 calculated linearly using
currDistance
, multiplied byMAX_POINTS
.
GetMousePoint
:
- Returns the position of the mouse projected onto the surface plane.
- Quicker way of calling
CursorController.MouseToPlanePoint()
.