// Update is called once per frame void Update() { m_Vector = CoordSystem.SphericalToCartesian(m_SphVector); //on fait tourner l'objet transform.RotateAround(m_PivotPoint.position, m_Vector.normalized, m_RotAngularSpeed * Time.deltaTime); VectorDisplayService.Display(name + ".rotVector", m_Vector, m_PivotPoint.position, m_VectorDisplayColor, m_VectorSizeMultiplier); }
// Update is called once per frame void Update() { m_Vector = CoordSystem.SphericalToCartesian(m_SphVector); //on fait tourner l'objet transform.Rotate(m_Vector.normalized, m_RotAngularSpeed * Time.deltaTime, m_RelativeTo); //On dessine le vecteur de rotation switch (m_RelativeTo) { case Space.World: VectorDisplayService.Display(name + ".vector", m_Vector, transform.position, m_VectorDisplayColor, m_VectorSizeMultiplier); break; case Space.Self: VectorDisplayService.Display(name + ".vector", transform.TransformDirection(m_Vector), transform.position, m_VectorDisplayColor, m_VectorSizeMultiplier); break; } }