harri.huhta Posted May 2, 2020 Share Posted May 2, 2020 (edited) Steps: -Add the following component to a primitive box -Use space / enter to trigger WorldRotate using System; using System.Collections; using System.Collections.Generic; using Unigine; [Component(PropertyGuid = "24c7af91cfafa3bcc0f32beb363ad04ec4089b55")] public class BugTester : Component { private void Update() { // write here code to be called before updating each render frame if (Input.IsKeyDown(Input.KEY.SPACE) || Input.IsKeyPressed(Input.KEY.RETURN)) { node.WorldRotate(new vec3(0,0,0.1f)); } Log.Message("rotation " + node.GetRotation()); Log.Message("position " + node.Position); Log.Message("scale " + node.Scale); } } With a Z rotation input vector the cube scales down on X and Y axises until the scale and rotation properties turn into NaN. Unigine 2.11.0.0 Community C# (edit, seems to work the same in C++ version too) WorldRotate.mp4 Edited May 2, 2020 by harri.huhta Link to comment
karpych11 Posted May 6, 2020 Share Posted May 6, 2020 Hello, This is a bug related to the quaternion constructor. Instead of node.WorldRotate(new vec3(0, 0, 0.1f)) you can use node.WorldRotate(0, 0, 0.1f) or node.WorldRotate(new quat(0, 0, 0.1f)). Link to comment
Recommended Posts