Jump to content

WorldRotate(vec3) scales object


photo

Recommended Posts

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)

Edited by harri.huhta
Link to comment

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
×
×
  • Create New...