Skip to content

Double transform fix for modular ships - #99

Open
ccp-intern wants to merge 4 commits into
mainfrom
double-transform-fix
Open

ccp-intern wants to merge 4 commits into
mainfrom
double-transform-fix

Conversation

@ccp-intern

Copy link
Copy Markdown
Member

https://fenriscreations.atlassian.net/browse/PLAT-12078

Fixed the issue: Modular ships build with EveSOF::BuildChild apply transformations twice to attachments, effect children, nested layouts and audio.

Last commit only. The other changes are part of #93

elements[0], elements[4], elements[8], 0.0f, elements[1], elements[5], elements[9], 0.0f, elements[2], elements[6], elements[10], 0.0f, elements[3], elements[7], elements[11], 1.0f );
}

bool IsMirrored( const Matrix& m )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to know where it is mirrored? f.ex couldn't a thing might be mirrored on both the x and y axis?

return Determinant( m ) < 0.f;
}

void DecomposeMirrorAware( Vector3& scale, Quaternion& rotation, Vector3& translation, const Matrix& m, int mirrorAxis )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thought as above, maybe switch out the mirrorAxis for a vector3 axes that is 1 for unmirrored and -1 for mirrored?
just a thought though...

Vector3 tmp;
Matrix m = TransformationMatrix( Vector3( 1.0f, 1.0f, 1.0f ), itemData->rotation, itemData->position + hullOffset ) * offset;
Decompose( tmp, spriteLineSetItem->m_rotation, spriteLineSetItem->m_position, m );
DecomposeMirrorAware( tmp, spriteLineSetItem->m_rotation, spriteLineSetItem->m_position, m, 1 );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why hardcoded to y and everything else is hardcoded to x?
Is there some logic that I'm missing?

if( m_boostersVisible )
{
auto& indexBuffer = Tr2Renderer::GetQuadListIndexBuffer();
auto& indexBuffer = m_parentMirrored ? Tr2Renderer::GetReversedQuadListIndexBuffer() : Tr2Renderer::GetQuadListIndexBuffer();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure that this is needed? does it matter if the quad is on a mirrored parent visually that is?


// And last but not least! AUDIO!
SetupAudio( BlueCastPtr( placementContainer ), dna, transform );
SetupAudio( BlueCastPtr( placementContainer ), dna, IdentityMatrix() );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this break for nested layouts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants