when I play around with ECS sample project’s for ForEach scene
I modified the code
public partial class RotationSpeedSystem_ForEach : SystemBase
{
// OnUpdate runs on the main thread.
protected override void OnUpdate()
{
float deltaTime = Time.DeltaTime;
// Schedule job to rotate around up vector
Entities
.WithName("RotationSpeedSystem_ForEach")
.ForEach((ref Rotation rotation, in RotationSpeed_ForEach rotationSpeed) =>
{
//rotation.Value = math.mul(
// math.normalize(rotation.Value),
// quaternion.AxisAngle(math.up(), rotationSpeed.RadiansPerSecond * deltaTime));
rotation.Value = math.mul(
math.normalize(rotation.Value),
quaternion.AxisAngle(new float3(500,0,0), rotationSpeed.RadiansPerSecond * deltaTime));
////////////////////////////////// see non- normalized float3/////////////
})
.ScheduleParallel();
}
}
Yeah, my mistake was omitting the normalizing (the float3) when putting in quaternion.AxisAngle(float3, float)
yet, I think this should be mentioned when docs will be released. Since, this rotation case is sensetive anyway:)