MCPcopy Create free account
hub / github.com/carbonengine/trinity / FillPerObjectData

Method FillPerObjectData

trinity/Eve/SpaceObject/Utils/EveCustomMask.cpp:66–82  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Fill in the needed PPT data into the perobject data --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

64// Fill in the needed PPT data into the perobject data
65// --------------------------------------------------------------------------------
66void EveCustomMask::FillPerObjectData( size_t n, EveSpaceObjectVSData* vsData, EveSpaceObjectPSData* psData ) const
67{
68 // projection matrix goes into VS data
69 Matrix customMaskTransform, invCustomMaskTransform;
70 customMaskTransform = TransformationMatrix( m_scaling, m_rotation, m_position );
71 invCustomMaskTransform = Inverse( customMaskTransform );
72 vsData->customMaskMatrix[n] = Transpose( invCustomMaskTransform );
73 // additional data
74 vsData->customMaskData[n] = Vector4( 1.f, m_isMirrored ? 1.f : 0.f, 0.f, 0.f );
75 // material source IDs go into PS data
76 psData->customMaskMaterialIDs[n] = Vector4( (float)m_materialIndex, 0.f, 0.f, 0.f );
77 // pattern targets go into PS data
78 psData->customMaskTargets[n] = m_targetMaterials;
79
80 psData->customMaskClamps[int32_t( n * 2 )] = m_clampU ? 1.f : 0.f;
81 psData->customMaskClamps[int32_t( n * 2 + 1 )] = m_clampV ? 1.f : 0.f;
82}
83
84// --------------------------------------------------------------------------------
85// Description:

Callers 1

UpdateAsyncronousMethod · 0.80

Calls 2

TransposeFunction · 0.85
Vector4Class · 0.50

Tested by

no test coverage detected