Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
617 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotationController : MonoBehaviour
{
#region Read-Only Fields
public float RotationPeriod => m_RotationPeriod;
public Vector3 Position => transform.position;
#endregion Read-Only Fields
[SerializeField]
private float m_RotationPeriod;
[SerializeField]
private Vector3 m_RotationAxis = Vector3.forward;
public Vector3 getDownDirection(Vector3 objectPosition)
{
return Vector3.ProjectOnPlane((objectPosition - transform.position).normalized, m_RotationAxis);
}
}