| 110 | } |
| 111 | |
| 112 | void SkinController::OnFirstUpdate() |
| 113 | { |
| 114 | // Get access to the vertex buffer positions to store the blended targets. |
| 115 | Visual* visual = reinterpret_cast<Visual*>(mObject); |
| 116 | VertexBuffer* vbuffer = visual->GetVertexBuffer().get(); |
| 117 | if (mNumVertices == static_cast<int32_t>(vbuffer->GetNumElements())) |
| 118 | { |
| 119 | // Get the position data. |
| 120 | VertexFormat vformat = vbuffer->GetFormat(); |
| 121 | int32_t const numAttributes = vformat.GetNumAttributes(); |
| 122 | for (int32_t i = 0; i < numAttributes; ++i) |
| 123 | { |
| 124 | VASemantic semantic{}; |
| 125 | DFType type{}; |
| 126 | uint32_t unit{}, offset{}; |
| 127 | vformat.GetAttribute(i, semantic, type, unit, offset); |
| 128 | if (semantic == VASemantic::POSITION && |
| 129 | (type == DF_R32G32B32_FLOAT || type == DF_R32G32B32A32_FLOAT)) |
| 130 | { |
| 131 | mPosition = vbuffer->GetData() + offset; |
| 132 | mStride = vformat.GetVertexSize(); |
| 133 | mCanUpdate = true; |
| 134 | break; |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | mCanUpdate = (mPosition != nullptr); |
| 140 | } |
| 141 | |
| 142 |
nothing calls this directly
no test coverage detected