Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform Component broken when using new(pos, rot, scale) #820

Open
wrestledBearOnce opened this issue Jul 11, 2023 · 0 comments · Fixed by #821
Open

Transform Component broken when using new(pos, rot, scale) #820

wrestledBearOnce opened this issue Jul 11, 2023 · 0 comments · Fixed by #821
Assignees
Labels

Comments

@wrestledBearOnce
Copy link
Member

wrestledBearOnce commented Jul 11, 2023

Bug

Calling this constructor:

public Transform(float3 translation, float3 rotation, float3 scale)

with (float3.Zero, float3.Zero, float3.One) fails due to this if-clause:

if (Translation != value)

as the value is already float3.Zero.

In extension of this, it prevents the generation of the _translationMtx via float4x4.CreateTranslation(value);

As the _translationMtx is initialized with float4x4.Zero all translation during scene traversal fails and no mesh is being rendered.

Same applies for scale and rotation.

@ASPePeX git blame: d069b79 😛

Fix

Initialize all matrices of this class with float4x4.Identity

@wrestledBearOnce wrestledBearOnce self-assigned this Jul 11, 2023
@wrestledBearOnce wrestledBearOnce linked a pull request Jul 11, 2023 that will close this issue
wrestledBearOnce added a commit that referenced this issue Jul 12, 2023
…mponent-broken-when-using-newpos-rot-scale

Fixed bug #820 - Transform.cs ctor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
1 participant