OROCHI
 
Loading...
Searching...
No Matches
GxUnitModelBase.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_CORE_NAMESPACE_BEGIN()
15//===========================================================================
17//===========================================================================
19{
20 //-----------------------------------------------------------
22 //-----------------------------------------------------------
24public:
25 GX_RTTI_CLASS_NAME_ICON(GxUnitModelBase, GxUnitLocate, "モデル基礎", GxRtti::ICON_TYPE::MESH)
26 // new, delete定義
27 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::UNIT)
28 // ClassBaseReference継承クラス用禁止宣言
30
31 struct GxJoint;
32
33#if GX_DEVELOP
34 struct GxRenderShaderDevInfo;
35#endif // GX_DEVELOP
36
38 enum class PASSINFO
39 {
40 NORMAL = 0,
41 SHADOW,
42 POINTSHADOW,
43 PREZ,
45 ENV,
46 POLYGONLINE,
47 MAX,
48 };
49
51 enum class MODEL_ATTRIBUTE
52 {
53 MESH_CULLING_ENABLE,
54 MESH_SHADOW_CULLING_ENABLE,
55 MESH_ENVIRONMENT_CULLING_ENABLE,
56 ORTHO_RENDER,
57 MAX,
58 };
59
60#if GX_DEVELOP
62 GX_FLAG_TABLE_MAX(MODEL_ATTRIBUTE)
63
64
65 enum class DEVELOP_FLAG
66 {
67 SHOW_MODEL,
68 SHOW_JOINT_DETAIL,
69 SHOW_JOINT_LINE,
70 SHOW_JOINT_NAME,
71 SHOW_JOINT_INDEX,
72 SHOW_JOINT_MATRIX,
73 SHOW_MESH_BOUNDING_BOX,
74 SHOW_MESH_VERTEX_NORMAL,
75 SHOW_MESH_VERTEX_TBN,
76 JOINT_HANDLE_CONTROL,
77 SHOW_SPECIFIED_JOINT_MATRIX,
78 BLINK_SPECIFIED_MATERIAL,
79 BLINK_SPECIFIED_MESH,
80 SHOW_BOUNDING_SPHERE,
81 UPDATE_RENDER_SHADER_DEVELOP_INFO,
82 DRAW_JOINT_OVERLAY,
83 MAX,
84 };
86 GX_FLAG_TABLE_MAX(DEVELOP_FLAG)
87#endif // GX_DEVELOP
88
89protected:
92 {
98#if GX_DEVELOP
99 GxMatrixAffine _parentMatrix;
100#endif // GX_DEVELOP
101 void updateMatrix(void);
102 void clear(void);
103 };
104
106 //-----------------------------------------------------------
108 //-----------------------------------------------------------
110public:
112 GxUnitModelBase(void);
113
115 void cleanup(void) override;
116
118 //-----------------------------------------------------------
120 //-----------------------------------------------------------
122protected:
124 void buildSpaceGraph(void* pOctree) override;
126 void eraseSpaceGraph(void* pOctree) override;
127
129 void frustumCulling( void* pFrustum ) override;
131 void forceSetCullingFlag( u32 argument ) override;
132
134 b32 frustumCullingMesh( GxShapeFrustum* pFrustum , RENDER_VIEW view, CULLING_FRUSTUM frustumType);
136 b32 frustumCullingInstance( GxShapeFrustum* pFrustum , RENDER_VIEW view, CULLING_FRUSTUM frustumType);
138 b32 setRenderShaderWithInfo(GxShaderPackage::GxShaderCode* pShaderCode, const GxRenderMaterial* pMaterial, PASSINFO index);
139
141 b32 setup(void) override;
143 void preAsyncUpdate(void) override;
145 void forceAsyncUpdate(void) override;
147 void render(void) override;
148
149public:
151 void updateLocalMatrix(void) override;
153 void updateWorldMatrix(void) override;
154
155#if GX_DEVELOP
157 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index);
159 void setResource(GxResBase* pResource) override;
160
162 b32 isUseTexture( GxRenderTexture* pTexture ) override;
163
164protected:
166 void developRender(void) override;
167
169 void developRenderJointHandle(void);
170#endif //GX_DEVELOP
171
172public:
174 virtual b32 setModelResource(GxResModel* pResModel);
176 GX_FORCE_INLINE virtual GxResModel* getModelResource(void) const { return _pResModel; }
178 constexpr GxResMaterial* getMaterialResource(u32 index = 0) { return _ppResMaterial ? _ppResMaterial[index] : nullptr; }
180 void setMaterialResource(u32 index, GxResMaterial* pResMaterial);
182 void setMaterialResourceAll(void);
183
184public:
186 virtual b32 recoveryMaterial(void);
188 void writeBackMaterial(void);
189
191 GX_FORCE_INLINE void* mapPartsIndexBuffer(u32 index, u32 mappingType) { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->mapPartsIndexBuffer(index, mappingType); }
193 GX_FORCE_INLINE void unmapPartsIndexBuffer(u32 index) { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->unmapPartsIndexBuffer(index); }
194
196 b32 copyMaterial(void);
197protected:
199 void setJointCount(u32 count);
201 virtual void setRenderMatrixCount(u32 count);
203 void setJointMultiplyMatrixCount(u32 count);
205 void setPartsFlagCount(u32 count);
207 void setPartsMatrix(u32 count);
209 void setMeshCullingFlagCount(u32 count);
211 void setMeshRenderFlagCount(u32 count);
212#if GX_ENABLE_OCCLUSION_CULLING
214 void setOcclusionQueryIndexCount(u32 count);
215#endif //GX_ENABLE_OCCLUSION_CULLING
216
218 virtual b32 renderInitialize(RENDER_VIEW view, RENDER_SUB_VIEW subView);
220 virtual void renderMeshGroupAll(void);
222 virtual void renderMeshGroup(const GxResModel::GxMeshGroup* pMeshGroup);
224 virtual void renderMesh(u32 startIndex, u32 count, const GxRenderMaterial* pMaterial, u32 instanceStartIndex, u32 instanceCount);
226 virtual void drawIndexed(u32 startIndex, u32 count, u32 instanceStartIndex, u32 instanceCount, RENDER_PRIMITIVE_TYPE primitiveType = RENDER_PRIMITIVE_TYPE::TRIANGLE_LIST, s32* pQueryIndex = nullptr);
227
229 virtual b32 setRenderProjectionMatrix(void);
231 b32 setRenderMaterial(GxRenderMaterial* pMaterial, const GxResModel::GxMeshGroup* pMeshGroup) override;
233 b32 setRenderGxSLMaterial(GxRenderMaterial* pMaterial);
235 virtual b32 setRenderPass(const GxRenderMaterial* pMaterial);
237 virtual b32 setRenderState(const GxRenderMaterial* pMaterial);
238#if GX_ENABLE_TESSELLATION
240 b32 setRenderShader(GxShaderPackage::GxShaderCode* pShaderCode, u32* pRenderVertexShaderSize = nullptr, u32* pRenderPixelShaderSize = nullptr, u32* pRenderHullShaderSize = nullptr, u32* pRenderDomainShaderSize = nullptr);
241#else //GX_ENABLE_TESSELLATION
243 b32 setRenderShader(GxShaderPackage::GxShaderCode* pShaderCode, u32* pRenderVertexShaderSize = nullptr, u32* pRenderPixelShaderSize = nullptr);
244#endif // !GX_ENABLE_TESSELLATION
245#if GX_ENABLE_COMPUTE_SHADER
247 b32 setComputeShader(GxShaderPackage::GxShaderCode* pShaderCode);
248#endif // GX_ENABLE_COMPUTE_SHADER
250 virtual void updateRenderMatrix(void);
252 virtual void updateInstanceRenderMatrix(RENDER_VIEW view, RENDER_SUB_VIEW subView);
253
255 virtual void updateShowLod(const GxUnitCameraBase* pCamera);
256
258 virtual void updateMeshRenderFlag(RENDER_VIEW view, CULLING_FRUSTUM renderSubView);
260 virtual void updateInstanceCullingFlag(const GxUnitCameraBase* pCamera, RENDER_VIEW view, CULLING_FRUSTUM frustumType);
261
263 void setCullingAllMeshs(void);
265 void clearMeshCullingFlag(const RENDER_VIEW& view, const CULLING_FRUSTUM& frustumType);
266
268 GX_FORCE_INLINE void clearMeshRenderFlag(void) { return GxFlag32Array::clear(_pMeshRenderFlag, getMeshRenderFlagCount()); }
269
271 void setCullingAllInstances(RENDER_VIEW view, CULLING_FRUSTUM pass);
273 void clearInstanceCullingFlag(RENDER_VIEW view, CULLING_FRUSTUM pass);
274
276 static s32 commitVertexBufferData(void* pSource, void* pArgument);
277
279 void loadShaderHandlesBase(void);
280private:
282 void setJointId(u32 jointIndex, GX_CSTR name);
283
284#if GX_DEVELOP
285public:
287 void saveMaterial(void);
289 void convertModel(void);
290
291protected:
293 void controlJointHandle(void);
295 void selectJointRecursively(GxJoint* pJoint);
296
298 void renderMeshVertexTBN(u32 meshIndex);
299
301 void addUnitOwnProperty(GxPropertyTable& table) override;
302
304 void updateSpecifiedJointIndexSafe(void);
305#endif // GX_DEVELOP
306
308 //-----------------------------------------------------------
310 //-----------------------------------------------------------
312protected:
314 GX_FORCE_INLINE void setPropertyModelResource(const void* const pValue) { setModelResource(*static_cast<GxResModel**>(const_cast<void*>(pValue))); }
316 GX_FORCE_INLINE void getPropertyModelResource(void* const pValue) { *static_cast<GxResModel**>(pValue) = getModelResource(); }
317
319 GX_FORCE_INLINE void getPropertyMaterialResource(void* const pValue, u32 index) { *static_cast<GxResMaterial**>(pValue) = getMaterialResource(index); }
321 GX_FORCE_INLINE void setPropertyMaterialResource(const void* const pValue, u32 index) { setMaterialResource(index, *static_cast<GxResMaterial**>(const_cast<void*>(pValue))); }
323 constexpr u32 getPropertyMaterialResourceCount(void) { return _pResModel ? _pResModel->getMaterialCount() : 0; }
325 constexpr void setPropertyMaterialResourceCount(const void* const /*pValue*/, u32 /*index*/) {}
326
328 void setPropertyLODDistance(const void* const pValue, u32 index);
330 GX_FORCE_INLINE void getPropertyLODDistance(void* const pValue, u32 index) { *static_cast<f32*>(pValue) = _pResModel ? _pResModel->getLodDistance(index) : 0; }
332 constexpr u32 getPropertyLODDistanceCount(void) { return static_cast<u32>(GxResModel::LOD::DISTANCE_MAX); }
334 constexpr void setPropertyLODDistanceCount(const void* const /*pValue*/, u32 /*index*/) {}
335
337 void setPropertyJoint(const void* const pValue, u32 index);
339 GX_FORCE_INLINE void getPropertyJoint(void* const pValue, u32 index) { *static_cast<GxJoint**>(pValue) = getJointFromIndex(index); }
341 constexpr void setPropertyJointCount(u32 /*count*/) {}
343 GX_FORCE_INLINE u32 getPropertyJointCount(void) { return getJointCount(); }
344
346 GX_FORCE_INLINE void setPropertyPartsFlag(const void* const pValue, u32 index) { setPartsFlag(index, *static_cast<b32*>(const_cast<void*>(pValue))); }
348 GX_FORCE_INLINE void getPropertyPartsFlag(void* const pValue, u32 index) { *static_cast<b32*>(pValue) = isPartsFlag(index); }
350 GX_FORCE_INLINE void setPropertyPartsFlagCount(u32 count) { setPartsFlagCount(count); }
352 GX_FORCE_INLINE u32 getPropertyPartsFlagCount(void) { return getPartsFlagCount(); }
354 GX_FORCE_INLINE void setPropertyPartsMatrix(const void* const pValue, u32 index) { setPartsMatrix(index, *static_cast<GxMatrixAffine*>(const_cast<void*>(pValue))); }
356 GX_FORCE_INLINE void getPropertyPartsMatrix(void* const pValue, u32 index) { *static_cast<GxMatrixAffine**>(pValue) = &getPartsMatrix(index); }
357
359 GX_FORCE_INLINE void setPropertyMeshCullingFlag(const void* const /*pValue*/, u32 index, u32 view, u32 pass) { _pMeshCullingFlag8[view][pass][index] = true; }
361 GX_FORCE_INLINE void getPropertyMeshCullingFlag(void* const pValue, u32 index, u32 view, u32 pass) { *static_cast<u8*>(pValue) = _pMeshCullingFlag8[view][pass][index]; }
363 GX_FORCE_INLINE void setPropertyMeshCullingFlagCount(u32 count) { setMeshCullingFlagCount(count); }
365 GX_FORCE_INLINE u32 getPropertyMeshCullingFlagCount(void) { return getMeshCullingFlagCount(); }
366
368 GX_FORCE_INLINE void setPropertyMeshRenderFlag(const void* const pValue, u32 index) { GxFlag32Array::setFlag(_pMeshRenderFlag, index, *static_cast<b32*>(const_cast<void*>(pValue))); }
370 GX_FORCE_INLINE void getPropertyMeshRenderFlag(void* const pValue, u32 index) { *static_cast<b32*>(pValue) = isMeshRenderFlag(index); }
372 GX_FORCE_INLINE void setPropertyMeshRenderFlagCount(u32 count) { setMeshRenderFlagCount(count); }
374 GX_FORCE_INLINE u32 getPropertyMeshRenderFlagCount(void) { return getMeshRenderFlagCount(); }
375
377 GX_FORCE_INLINE void setPropertyMaterial(const void* const /*pValue*/, u32 /*index*/) {}
379 GX_FORCE_INLINE void getPropertyMaterial(void* const pValue, u32 index) { *static_cast<GxRenderMaterial**>(pValue) = getMaterial(index); }
381 constexpr void setPropertyMaterialCount(u32 /*count*/) {}
383 GX_FORCE_INLINE u32 getPropertyMaterialCount(void) { if( _pResModel ) { return _pResModel->getMaterialCount(); } else { return 0; } }
384
385#if GX_DEVELOP
387 GX_FORCE_INLINE void eventConvertModel(void) { convertModel(); }
388#endif //GX_DEVELOP
389
391 GX_FORCE_INLINE void setPropertyInstanceCount(const void* const pValue) { setInstanceCount(*static_cast<u32*>(const_cast<void*>(pValue))); }
393 GX_FORCE_INLINE void getPropertyInstanceCount(void* const pValue) { *static_cast<u32*>(pValue) = getInstanceCount(); }
394
396 GX_FORCE_INLINE void setPropertyInstancePosition(const void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); _pInstanceDataArray[index]._position = *static_cast<GxVector3*>(const_cast<void*>(pValue)); } }
398 GX_FORCE_INLINE void getPropertyInstancePosition(void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); *static_cast<GxVector3**>(pValue) = &_pInstanceDataArray[index]._position; } }
400 GX_FORCE_INLINE void setPropertyInstancePositionCount(u32 count) { setInstanceCount(count); }
402 GX_FORCE_INLINE u32 getPropertyInstancePositionCount(void) { return getInstanceCount(); }
403
405 GX_FORCE_INLINE void setPropertyInstanceQuaternion(const void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); _pInstanceDataArray[index]._quaternion = *static_cast<GxQuaternion*>(const_cast<void*>(pValue)); } }
407 GX_FORCE_INLINE void getPropertyInstanceQuaternion(void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); *static_cast<GxQuaternion**>(pValue) = &_pInstanceDataArray[index]._quaternion; } }
409 GX_FORCE_INLINE void setPropertyInstanceQuaternionCount(u32 count) { setInstanceCount(count); }
411 GX_FORCE_INLINE u32 getPropertyInstanceQuaternionCount(void) { return getInstanceCount(); }
412
414 GX_FORCE_INLINE void setPropertyInstanceScale(const void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); _pInstanceDataArray[index]._scale = *static_cast<GxVector3*>(const_cast<void*>(pValue)); } }
416 GX_FORCE_INLINE void getPropertyInstanceScale(void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); *static_cast<GxVector3**>(pValue) = &_pInstanceDataArray[index]._scale; } }
418 GX_FORCE_INLINE void setPropertyInstanceScaleCount(u32 count) { setInstanceCount(count); }
420 GX_FORCE_INLINE u32 getPropertyInstanceScaleCount(void) { return getInstanceCount(); }
421
423 GX_FORCE_INLINE void setPropertyInstanceOffsetMatrix(const void* const pValue, u32 index) { setInstanceOffsetMatrix(index, *static_cast<GxMatrixAffine*>(const_cast<void*>(pValue))); }
425 GX_FORCE_INLINE void getPropertyInstanceOffsetMatrix(void* const pValue, u32 index) { *static_cast<GxMatrixAffine**>(pValue) = &getInstanceOffsetMatrix(index); }
427 constexpr void setPropertyInstanceOffsetMatrixCount(u32 /*count*/) {}
429 GX_FORCE_INLINE u32 getPropertyInstanceOffsetMatrixCount(void) { return 1 < getInstanceCount() ? getInstanceCount() : 0; }
430
431#if GX_DEVELOP
433 GX_FORCE_INLINE void setPropertyInstanceParentMatrix(const void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); _pInstanceDataArray[index]._parentMatrix = *static_cast<GxMatrixAffine*>(const_cast<void*>(pValue)); } }
435 GX_FORCE_INLINE void getPropertyInstanceParentMatrix(void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); *static_cast<GxMatrixAffine**>(pValue) = &_pInstanceDataArray[index]._parentMatrix; } }
437 constexpr void setPropertyInstanceParentMatrixCount(u32 /*count*/) {}
439 GX_FORCE_INLINE u32 getPropertyInstanceParentMatrixCount(void) { return 1 < getInstanceCount() ? getInstanceCount() : 0; }
440#endif // GX_DEVELOP
441
443 GX_FORCE_INLINE void setPropertyInstanceShowFlag(const void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { setInstanceShowFlag(index, *static_cast<b32*>(const_cast<void*>(pValue))); } }
445 GX_FORCE_INLINE void getPropertyInstanceShowFlag(void* const pValue, u32 index) { if( getInstanceCount() > 0 ) { *static_cast<b32*>(pValue) = isInstanceShowFlag(index); } }
447 constexpr void setPropertyInstanceShowFlagCount(u32 /*count*/) {}
449 GX_FORCE_INLINE u32 getPropertyInstanceShowFlagCount(void) { return 1 < getInstanceCount() ? getInstanceCount() : 0; }
450
451#if GX_DEVELOP
453 GX_FORCE_INLINE void getPropertyRenderDevelopInfoNormal(void* const pValue, u32 index) { *static_cast<GxRenderShaderDevInfo**>(pValue) = getRenderPassInfo(PASSINFO::NORMAL, index); }
455 GX_FORCE_INLINE void getPropertyRenderDevelopInfoShadow(void* const pValue, u32 index) { *static_cast<GxRenderShaderDevInfo**>(pValue) = getRenderPassInfo(PASSINFO::SHADOW, index); }
457 GX_FORCE_INLINE void getPropertyRenderDevelopInfoPointShadow(void* const pValue, u32 index) { *static_cast<GxRenderShaderDevInfo**>(pValue) = getRenderPassInfo(PASSINFO::POINTSHADOW, index); }
459 GX_FORCE_INLINE void getPropertyRenderDevelopInfoPreZ(void* const pValue, u32 index) { *static_cast<GxRenderShaderDevInfo**>(pValue) = getRenderPassInfo(PASSINFO::PREZ, index); }
461 GX_FORCE_INLINE void getPropertyRenderDevelopInfoMotionBlur(void* const pValue, u32 index) { *static_cast<GxRenderShaderDevInfo**>(pValue) = getRenderPassInfo(PASSINFO::MOTIONBLUR, index); }
463 GX_FORCE_INLINE void getPropertyRenderDevelopInfoEnvironment(void* const pValue, u32 index) { *static_cast<GxRenderShaderDevInfo**>(pValue) = getRenderPassInfo(PASSINFO::ENV, index); }
465 GX_FORCE_INLINE void getPropertyRenderDevelopInfoPolygonLine(void* const pValue, u32 index) { *static_cast<GxRenderShaderDevInfo**>(pValue) = getRenderPassInfo(PASSINFO::POLYGONLINE, index); }
467 GX_FORCE_INLINE u32 getPropertyRenderDevelopInfoCount(void) { if( _pResModel ) { return _pResModel->getMaterialCount(); } else { return 0; } }
469 constexpr void setPropertyRenderDevelopInfoCount(void* const /*pValue*/, u32 /*index*/) {}
471 constexpr void setPropertyRenderDevelopInfo(void* const /*pValue*/, u32 /*index*/ ) {}
473 void getPropertySpecifiedJointId(void* const pValue);
475 void setPropertySpecifiedJointId(const void* const pValue);
476
478 GX_FORCE_INLINE void getPropertyVertexDeclarationPrecisionTypeTexcoord(void* const pValue) { if( getModelResource() && getModelResource()->getConfig() ) { *(GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_TYPE*)pValue = getModelResource()->getVertexDeclarationPrecisionType( GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_GROUP::TEXCOORD ); } }
480 GX_FORCE_INLINE void setPropertyVertexDeclarationPrecisionTypeTexcoord(const void* const pValue) { if( getModelResource() && getModelResource()->getConfig() ) { getModelResource()->setVertexDeclarationPrecisionType( GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_GROUP::TEXCOORD, *static_cast<GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_TYPE*>(const_cast<void*>(pValue)) ); } }
482 GX_FORCE_INLINE void getPropertyVertexDeclarationPrecisionTypeNormal(void* const pValue) { if( getModelResource() && getModelResource()->getConfig() ) { *(GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_TYPE*)pValue = getModelResource()->getVertexDeclarationPrecisionType( GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_GROUP::NORMAL ); } }
484 GX_FORCE_INLINE void setPropertyVertexDeclarationPrecisionTypeNormal(const void* const pValue) { if( getModelResource() && getModelResource()->getConfig() ) { getModelResource()->setVertexDeclarationPrecisionType( GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_GROUP::NORMAL, *static_cast<GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_TYPE*>(const_cast<void*>(pValue)) ); } }
486 GX_FORCE_INLINE void getPropertyVertexDeclarationPrecisionTypeBinormalTangent(void* const pValue) { if( getModelResource() && getModelResource()->getConfig() ) { *(GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_TYPE*)pValue = getModelResource()->getVertexDeclarationPrecisionType( GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_GROUP::BINORMAL_TANGENT ); } }
488 GX_FORCE_INLINE void setPropertyVertexDeclarationPrecisionTypeBinormalTangent(const void* const pValue) { if( getModelResource() && getModelResource()->getConfig() ) { getModelResource()->setVertexDeclarationPrecisionType( GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_GROUP::BINORMAL_TANGENT, *static_cast<GxResModel::VERTEX_DECLARATION_ELEMENT_PRECISION_TYPE*>(const_cast<void*>(pValue)) ); } }
489#endif // GX_DEVELOP
490
491public:
493 GX_FORCE_INLINE virtual u32 getJointCount(void) const { if( _pResModel ) { return _pResModel->getJointCount(); } else { return 0; } }
495 GxJoint* getJointFromIndex(u32 index) const;
496
498 GxJoint* getJointFromId(u32 id) const;
500 u32 getJointIndexFromId(u32 id) const;
501
503 GX_FORCE_INLINE u32 getPartsFlagCount(void) const { if( _pResModel ) { return _pResModel->getPartsCount(); } else { return 0; } }
505 GX_FORCE_INLINE b32 isPartsFlag(u32 index) const { return GxFlag32Array::isFlag(_pPartsFlag, index); }
507 GX_FORCE_INLINE void setPartsFlag(u32 index, b32 enable) { GxFlag32Array::setFlag(_pPartsFlag, index, enable); }
509 GX_FORCE_INLINE s32 getPartsIndex(GX_CSTR partsName) const { return _pResModel ? _pResModel->getPartsIndex(partsName) : -1; }
511 GX_FORCE_INLINE b32 isUsePartsMatrix(void){ return _usePartsMatrixFlag; }
513 GX_FORCE_INLINE void setUsePartsMatrix(b32 on){ _usePartsMatrixFlag = on; }
515 GxMatrixAffine& getPartsMatrix(u32 index) const;
517 void setPartsMatrix(u32 index, const GxMatrixAffine& matrix);
518
520 GxRenderVertexDeclaration* getPartsVertexDeclaration(u32 index) const;
522 GX_FORCE_INLINE u32 getPartsVertexCount(u32 index) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getPartsVertexCount(index); }
524 GX_FORCE_INLINE u32 getPartsVertexStride(u32 index, u16 vertexStream) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getPartsVertexStride(index, vertexStream); }
525
527 GX_FORCE_INLINE RENDER_INDEX_TYPE getPartsIndexType(u32 index) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getPartsIndexType(index); }
529 GX_FORCE_INLINE u32 getPartsIndexOffset(u32 index) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getPartsIndexOffset(index); }
531 GX_FORCE_INLINE u32 getPartsIndexCount(u32 index) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getPartsIndexCount(index); }
533 GX_FORCE_INLINE u32 getPartsIndexMinimum(u32 index) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getPartsIndexMinimum(index); }
534
536 void getMeshWorldMatrix( GxMatrixAffine& world, const u32& meshIndex );
537
539 GX_FORCE_INLINE u32 getMeshIndexFromPartsIndex(u32 partsIndex) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getMeshIndexFromPartsIndex(partsIndex); }
541 GX_FORCE_INLINE u32 getMeshGroupIndexFromMeshIndex(u32 meshIndex) const { GX_ASSERT(_pResModel, "モデルリソースが設定されていません"); return _pResModel->getMeshGroupIndexFromMeshIndex(meshIndex); }
542
544 constexpr u32 getMeshCullingFlagCount(void) const { if( _pResModel ) { return _pResModel->getMeshCount(); } else { return 0; } }
546 GX_FORCE_INLINE b32 isMeshCullingFlag(u32 index, RENDER_VIEW view, CULLING_FRUSTUM pass) const { return _pMeshCullingFlag8[static_cast<s32>(view)][static_cast<s32>(pass)][index] > 0 ? true : false; }
548 constexpr u32 getMeshRenderFlagCount(void) const { if( _pResModel ) { return _pResModel->getMeshCount(); } else { return 0; } }
550 GX_FORCE_INLINE b32 isMeshRenderFlag(u32 index) const { return GxFlag32Array::isFlag(_pMeshRenderFlag, index); }
551
553 constexpr u32 getMaterialCount(void) const { if( _pResModel ) { return _pResModel->getMaterialCount(); } else { return 0; } }
555 GxRenderMaterial* getMaterial(u32 index);
556
558 GX_FORCE_INLINE b32 isModelAttribute(MODEL_ATTRIBUTE attribute) const { return _modelAttribute.isFlag(attribute); }
560 GX_FORCE_INLINE void setModelAttribute(MODEL_ATTRIBUTE attribute, b32 enable) { _modelAttribute.setFlag(attribute, enable); }
561
563 constexpr GxResModel::LOD getShowLod(void) const { return _showLod; }
565 constexpr void setShowLod(GxResModel::LOD showLod) { _showLod = showLod; }
566
568 constexpr GxResModel::LOD getLodMode(void) const { return _lodMode; }
570 constexpr void setLodMode(GxResModel::LOD lodMode) { _lodMode = lodMode; }
571
573 const GxMatrixAffine& getInstanceMatrix(u32 index) const;
575 GxMatrixAffine& getInstanceMatrix(u32 index);
577 void setInstanceMatrix(u32 index, const GxMatrixAffine& matrix);
579 constexpr u32 getInstanceCount(void) const { return _instanceCount; }
581 virtual void setInstanceCount(u32 count);
583 void reserveInstanceMemory(u32 count);
585 void freeInstanceMemory(void);
587 GX_FORCE_INLINE b32 isInstanced(void) const { return 0 < _instanceCount; }
589 GX_FORCE_INLINE void setUseJointMultiplyMatrix(b32 use) { _useJointMultiplyMatrix = use; }
591 GX_FORCE_INLINE b32 getUseJointMultiplyMatrix(void) { return _useJointMultiplyMatrix; }
593 void setJointMultiplyMatrix(u32 index, const GxMatrixAffine& matrix);
595 void resetJointMultiplyMatrix(void);
597 void updateJointMultiplyMatrix(void);
599 GX_FORCE_INLINE GxCriticalSection* getMaterialCriticalSection(void) { if (_pResModel) { return _pResModel->getMaterialCriticalSection(); } else { return nullptr; } }
600
601#if GX_DEVELOP
603 GxRenderShaderDevInfo * getRenderPassInfo(PASSINFO index, u32 materialIndex);
604
606 GX_FORCE_INLINE void setInstancePosition(const GxVector3& position, u32 index) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); _pInstanceDataArray[index]._position = position; }
608 GX_FORCE_INLINE GxVector3& getInstancePosition(u32 index) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); return _pInstanceDataArray[index]._position; }
609
611 GX_FORCE_INLINE void setInstanceQuaternion(const GxQuaternion& quaternion, u32 index) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); _pInstanceDataArray[index]._quaternion = quaternion; }
613 GX_FORCE_INLINE GxQuaternion& getInstanceQuaternion(u32 index) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); return _pInstanceDataArray[index]._quaternion; }
614
616 GX_FORCE_INLINE void setInstanceScale(const GxVector3& scale, u32 index) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); _pInstanceDataArray[index]._scale = scale; }
618 GX_FORCE_INLINE GxVector3& getInstanceScale(u32 index) { GX_ASSERT(index < getInstanceCount(), "インスタンスインデックスエラー"); return _pInstanceDataArray[index]._scale; }
619#endif // GX_DEVELOP
620
622 const GxMatrixAffine& getInstanceOffsetMatrix(u32 index) const;
624 GxMatrixAffine& getInstanceOffsetMatrix(u32 index);
626 void setInstanceOffsetMatrix(u32 index, const GxMatrixAffine& matrix);
628 GX_FORCE_INLINE b32 isInstanceShowFlag(u32 index) const { return GxFlag32Array::isFlag(_pInstanceShowFlag, index); }
630 GX_FORCE_INLINE void setInstanceShowFlag(u32 index, b32 enable) { GxFlag32Array::setFlag(_pInstanceShowFlag, index, enable); }
632 GX_FORCE_INLINE b32 isInstanceCullingFlag(u32 index, RENDER_VIEW view, u32 pass) const { return _pppInstanceCullingFlag8[static_cast<s32>(view)][pass][index] ? true : false; }
634 b32 hasSkin(void) const;
635
636#if GX_DEVELOP
638 GxJoint* getNearestJoint( const GxVector3& rayStart, const GxVector3& rayEnd );
640 void setHandleJoint( const s32 jointIndex );
641
643 GX_FORCE_INLINE b32 isDevelopFlag(DEVELOP_FLAG flag) { return _developFlag.isFlag(flag); }
645 GX_FORCE_INLINE void setDevelopFlag(DEVELOP_FLAG flag, b32 enable) { _developFlag.setFlag(flag, enable); }
646
648 constexpr u32 getSpecifiedJointIndex(void) const { return _specifiedJointIndex; }
650 constexpr void setSpecifiedJointIndex(u32 index) { _specifiedJointIndex = index; }
652 constexpr u32 getSpecifiedMaterialIndex(void) const { return _specifiedMaterialIndex; }
654 constexpr void setSpecifiedMaterialIndex(u32 index) { _specifiedMaterialIndex = index; }
655
656#endif // GX_DEVELOP
657
659 //-----------------------------------------------------------
661 //-----------------------------------------------------------
663protected:
665
668
670
675
676 // TODO: ここをまとめる
680
686
687 u8* _pMeshCullingFlag8[static_cast<s32>(RENDER_VIEW::_3D_MAX)][static_cast<s32>(CULLING_FRUSTUM::MAX)];
694#if GX_ENABLE_OCCLUSION_CULLING
695 s32* _pOcclusionQueryIndex[RENDER_BUFFER_COUNT_MAX];
696 s32 _defaultOcclusionQueryIndex[RENDER_BUFFER_COUNT_MAX];
697#endif //GX_ENABLE_OCCLUSION_CULLING
698
702
705#if GX_DEVELOP
706 u32 _saveInstanceCount;
707#endif // GX_DEVELOP
718
719#if GX_DEVELOP
720 GxFlag32Index<DEVELOP_FLAG> _developFlag;
721
722 GxHandle* _pJointHandle;
723 u32 _specifiedJointIndex;
724 u32 _specifiedMaterialIndex;
725 u32 _specifiedMeshIndex;
726 u32 _blinkCounter;
727
728 b32 _isAllMeshBlink;
729 b32 _isAlreadyBlink;
730 f32 _blinkTimer;
731 GxRenderShaderDevInfo* _pRenderPassInfo[static_cast<s32>(PASSINFO::MAX)];
732 GxRenderShaderDevInfo* _pRenderPassInfoBuffer;
733
734 u32 _jointFontSize;
735 GxColor _jointFontColor;
736#endif // GX_DEVELOP
737
738 // シェーダハンドル
747#if GX_USE_HLSL
748 static GX_HANDLE _handleCubeMapSamplerState;
749#endif // GX_USE_HLSL
750private:
751 static GxCriticalSection _shaderHandleCriticalSectionBase;
752
754};
755
756#if GX_DEVELOP
757//===========================================================================
759//===========================================================================
760struct GxUnitModelBase::GxRenderShaderDevInfo : public GxStructBase
761{
762 //-----------------------------------------------------------
764 //-----------------------------------------------------------
766public:
767 GX_RTTI_STRUCT(GxRenderShaderDevInfo)
768
769
770 //-----------------------------------------------------------
772 //-----------------------------------------------------------
774
776 GxRenderShaderDevInfo(void);
777
779 //-----------------------------------------------------------
781 //-----------------------------------------------------------
783
784 u32 vertexShaderSize;
785 u32 pixelShaderSize;
786
788};
789#endif // GX_DEVELOP
790
791//===========================================================================
793//===========================================================================
795{
796 //-----------------------------------------------------------
798 //-----------------------------------------------------------
800public:
801 GX_RTTI_STRUCT(GxJoint)
802 // new, delete定義
803 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::UNIT)
804
805 // 属性定義
806 enum class ATTRIBUTE
807 {
808 WORLD,
810 MAX,
811 };
812#if GX_DEVELOP
814 GX_FLAG_TABLE_MAX(ATTRIBUTE)
815#endif //GX_DEVELOP
816
818 //-----------------------------------------------------------
820 //-----------------------------------------------------------
822
824 GxJoint(void);
825
827 //-----------------------------------------------------------
829 //-----------------------------------------------------------
831public:
833 void updateLocalMatrix(void);
835 void updateWorldMatrix(const GxMatrixAffine& worldMatrix);
836
837#if GX_DEVELOP
839 void developRenderJointDetail(b32 isOverlay = false);
841 void developRenderJointLine(b32 isOverlay = false);
842
844 void developRenderJointNameAndIndex(u32 size, GxColor color);
846 void developRenderJointName(u32 size, GxColor color);
848 void developRenderJointIndex(u32 size, GxColor color);
850 void developRenderJointMatrix(b32 isOverlay = false);
851
853 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index);
854
856 b32 isHitRay(const GxVector3& rayStart, const GxVector3& rayEnd, f32& param);
857#endif //GX_DEVELOP
858
860 //-----------------------------------------------------------
862 //-----------------------------------------------------------
864
866 constexpr u32 getIndex(void) const { return _index; }
868 constexpr void setIndex(u32 index) { _index = index; }
870 constexpr s32 getId(void) const { return _id; }
872 constexpr void setId(s32 id) { _id = id; }
874 constexpr GX_CSTR getName(void) const { return _name; }
876 constexpr void setName(GX_CSTR name) { _name = name; }
878 constexpr GxJoint* getParentJoint(void) const { return _pParentJoint; }
880 constexpr void setParentJoint(GxJoint* pJoint) { _pParentJoint = pJoint; }
882 constexpr GxJoint* getChildJoint(void) const { return _pChildJoint; }
884 constexpr void setChildJoint(GxJoint* pJoint) { _pChildJoint = pJoint; }
886 constexpr GxJoint* getBrotherJoint(void) const { return _pBrotherJoint; }
888 constexpr void setBrotherJoint(GxJoint* pJoint) { _pBrotherJoint = pJoint; }
889
891 GX_FORCE_INLINE const GxMatrixAffine& getLocalMatrix(void) const { return _localMatrix; }
893 GX_FORCE_INLINE void setLocalMatrix(const GxMatrixAffine& localMatrix) { _localMatrix = localMatrix; }
895 GX_FORCE_INLINE void setLocalMatrix(const GxMatrixAffine& localMatrix, const GxVector3& offset) { _localMatrix = localMatrix; _localMatrix.setPosition( offset ); }
896
898 GX_FORCE_INLINE const GxMatrixAffine& getWorldMatrix(void) const { return _worldMatrix; }
900 GX_FORCE_INLINE void setWorldMatrix(const GxMatrixAffine& worldMatrix) { _worldMatrix = worldMatrix; }
901
903 GX_FORCE_INLINE const GxMatrixAffine& getOrientMatrix(void) const { return *_pOrientMatrix; }
905 GX_FORCE_INLINE void setOrientMatrix(const GxMatrixAffine* pMatrix) { _pOrientMatrix = pMatrix; }
907 GX_FORCE_INLINE const GxMatrixAffine& getInversMatrix(void) const { return *_pInversMatrix; }
909 GX_FORCE_INLINE void setInversMatrix(const GxMatrixAffine* pMatrix) { _pInversMatrix = pMatrix; }
910
912 GX_FORCE_INLINE const GxVector3& getPosition(void) const{ return _position; }
914 GX_FORCE_INLINE void setPosition(const GxVector3& position){ _position = position; }
916 GX_FORCE_INLINE const GxQuaternion& getQuaternion(void) const { return _quaternion; }
918 GX_FORCE_INLINE void setQuaternion(const GxQuaternion& quaternion){ _quaternion = quaternion; }
920 GX_FORCE_INLINE const GxVector3& getScale(void) const { return _scale; }
922 GX_FORCE_INLINE void setScale(const GxVector3& scale) { _scale = scale; }
923
925 GX_FORCE_INLINE b32 isAttribute(ATTRIBUTE attribute) const { return _attribute.isFlag(attribute); }
927 GX_FORCE_INLINE void setAttribute(ATTRIBUTE attribute, b32 enable) { _attribute.setFlag(attribute, enable); }
928
929#if GX_DEVELOP
931 GX_FORCE_INLINE b32 isHandleSelected(void) const { return _isHandleSelected; }
933 GX_FORCE_INLINE void setIsHandleSelected(b32 isSelected) { _isHandleSelected = isSelected; }
935 void setHandleParam(GxHandle& handle);
936#endif // GX_DEVELOP
937
939 //-----------------------------------------------------------
941 //-----------------------------------------------------------
943private:
944 u32 _index;
945 s32 _id;
946 GX_CSTR _name;
947 GxJoint* _pParentJoint;
948 GxJoint* _pChildJoint;
949 GxJoint* _pBrotherJoint;
950 GxMatrixAffine _localMatrix;
951 GxMatrixAffine _worldMatrix;
952 GxVector3 _position;
953 GxQuaternion _quaternion;
954 GxVector3 _scale;
955 const GxMatrixAffine* _pOrientMatrix;
956 const GxMatrixAffine* _pInversMatrix;
957 GxFlag32Index<ATTRIBUTE> _attribute;
958#if GX_DEVELOP
959 b32 _isHandleSelected;
960#endif // GX_DEVELOP
961
963};
964
965GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
@ MAX
定義数
void GxTypedObject
その他
Definition GxDefine.h:213
u32 GX_HANDLE
ハンドル
Definition GxDefine.h:214
RENDER_VIEW
描画優先度(ビュー)
Definition GxRender.h:442
@ _3D_MAX
汎用的な3Dビューの最大
@ NORMAL
法線(VS入力,VS→PS)
RENDER_INDEX_TYPE
インデックスバッファ形式
Definition GxRender.h:147
RENDER_PRIMITIVE_TYPE
プリミティブ形式
Definition GxRender.h:131
@ TRIANGLE_LIST
トライアングルリスト
@ SHADOW
0番目はシャドウパスで暗黙的に使われている
@ RENDER_BUFFER_COUNT_MAX
トリプルバッファリング
Definition GxRender.h:20
RENDER_SUB_VIEW
描画優先度(サブビュー)
Definition GxRender.h:485
@ MOTIONBLUR
モーションブラー
クリティカルセクションクラス
Definition GxThread.h:20
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
マテリアル構造体
Definition GxRenderMaterial.h:18
テクスチャクラス
Definition GxRenderTexture.h:19
頂点シェーダに渡す頂点の宣言を管理する
Definition GxRenderVertexDeclaration.h:22
リソース基底クラス
Definition GxResBase.h:23
マテリアルリソース
Definition GxResMaterial.h:18
モデルリソースクラス
Definition GxResModel.h:20
LOD
LOD定義
Definition GxResModel.h:33
@ DISTANCE_MAX
LOD距離の定義数
VERTEX_DECLARATION_ELEMENT_PRECISION_TYPE
頂点データの精度タイプの定義
Definition GxResModel.h:65
実行時型情報クラス
Definition GxRtti.h:154
@ MESH
メッシュ
角錐台
Definition GxShape.h:531
ATTRIBUTE
属性
Definition GxUnitBase.h:71
カメラ基礎クラス
Definition GxUnitCameraBase.h:20
座標ユニット基礎クラス
Definition GxUnitLocate.h:23
CULLING_FRUSTUM
フラスタムカリング定義
Definition GxUnitLocate.h:48
モデル基礎クラス
Definition GxUnitModelBase.h:19
virtual GX_FORCE_INLINE u32 getJointCount(void) const
関節数を取得
Definition GxUnitModelBase.h:493
GX_FORCE_INLINE u32 getPropertyJointCount(void)
関節数を取得
Definition GxUnitModelBase.h:343
GX_FORCE_INLINE void getPropertyMeshRenderFlag(void *const pValue, u32 index)
メッシュ描画フラグを取得
Definition GxUnitModelBase.h:370
b32 _isInstanceCullingFlag
インスタンスカリングを有効にするか?
Definition GxUnitModelBase.h:690
GX_FORCE_INLINE void setPropertyInstanceQuaternion(const void *const pValue, u32 index)
インスタンス回転を設定
Definition GxUnitModelBase.h:405
GX_FORCE_INLINE void getPropertyLODDistance(void *const pValue, u32 index)
LOD距離を取得
Definition GxUnitModelBase.h:330
GxRenderMaterial * _pMaterial
マテリアル
Definition GxUnitModelBase.h:669
GX_FORCE_INLINE u32 getPartsVertexCount(u32 index) const
パーツの頂点数を取得
Definition GxUnitModelBase.h:522
constexpr void setPropertyJointCount(u32)
関節数を設定
Definition GxUnitModelBase.h:341
GxResModel::LOD _showLod
表示LOD
Definition GxUnitModelBase.h:700
GxMatrixAffineGpu * _pRenderInstanceMatrix
インスタンスの描画マトリクス
Definition GxUnitModelBase.h:711
GX_FORCE_INLINE void setPropertyMaterial(const void *const, u32)
マテリアルを設定
Definition GxUnitModelBase.h:377
GX_FORCE_INLINE void setModelAttribute(MODEL_ATTRIBUTE attribute, b32 enable)
属性の設定
Definition GxUnitModelBase.h:560
GxMatrixAffine * _pPartsMatrix
パーツのマトリクス
Definition GxUnitModelBase.h:709
GX_FORCE_INLINE void setPropertyPartsFlag(const void *const pValue, u32 index)
パーツフラグを設定
Definition GxUnitModelBase.h:346
GX_FORCE_INLINE void setPropertyInstanceShowFlag(const void *const pValue, u32 index)
インスタンス表示を設定
Definition GxUnitModelBase.h:443
GX_FORCE_INLINE u32 getPartsIndexCount(u32 index) const
パーツのインデックス数を取得
Definition GxUnitModelBase.h:531
u32 * _pPartsFlag
パーツフラグ
Definition GxUnitModelBase.h:677
GX_FORCE_INLINE b32 getUseJointMultiplyMatrix(void)
ジョイントの乗算マトリクスを使用するフラッグの取得
Definition GxUnitModelBase.h:591
u32 _defaultMeshRenderFlag
初期メッシュ描画フラグ
Definition GxUnitModelBase.h:692
GxMatrixAffineGpu * _pRenderMatrix
描画マトリクス
Definition GxUnitModelBase.h:673
GX_FORCE_INLINE void getPropertyInstanceShowFlag(void *const pValue, u32 index)
インスタンス表示を取得
Definition GxUnitModelBase.h:445
GX_FORCE_INLINE void getPropertyPartsFlag(void *const pValue, u32 index)
パーツフラグを取得
Definition GxUnitModelBase.h:348
GX_FORCE_INLINE u32 getPartsFlagCount(void) const
パーツフラグ数を取得
Definition GxUnitModelBase.h:503
GX_FORCE_INLINE void setPropertyInstanceScale(const void *const pValue, u32 index)
インスタンススケールを設定
Definition GxUnitModelBase.h:414
b32 _useJointMultiplyMatrix
ジョイントの乗算マトリクスを使用するフラグ
Definition GxUnitModelBase.h:683
GX_FORCE_INLINE void setPropertyPartsFlagCount(u32 count)
パーツフラグ数を設定
Definition GxUnitModelBase.h:350
GX_FORCE_INLINE void setUseJointMultiplyMatrix(b32 use)
ジョイントの乗算マトリクスを使用するフラッグの設定
Definition GxUnitModelBase.h:589
u32 _passNum
フラグ確保されたパスの数
Definition GxUnitModelBase.h:682
GX_FORCE_INLINE void setPropertyMaterialResource(const void *const pValue, u32 index)
マテリアルリソースを設定(プロパティ用)
Definition GxUnitModelBase.h:321
GX_FORCE_INLINE void getPropertyInstancePosition(void *const pValue, u32 index)
インスタンス座標を取得
Definition GxUnitModelBase.h:398
constexpr void setLodMode(GxResModel::LOD lodMode)
LODモードの設定
Definition GxUnitModelBase.h:570
GxMatrix44 _renderProjMatrix
描画プロジェクションマトリクス
Definition GxUnitModelBase.h:672
GX_FORCE_INLINE void setInstanceShowFlag(u32 index, b32 enable)
インスタンス表示フラグを設定
Definition GxUnitModelBase.h:630
GX_FORCE_INLINE void getPropertyMaterial(void *const pValue, u32 index)
マテリアルを取得
Definition GxUnitModelBase.h:379
static GX_HANDLE _handleWorldViewMatrix
ワールドビュー行列ハンドル
Definition GxUnitModelBase.h:741
constexpr u32 getPropertyLODDistanceCount(void)
LOD数を取得
Definition GxUnitModelBase.h:332
GX_FORCE_INLINE void setPropertyInstanceScaleCount(u32 count)
インスタンススケール数を設定
Definition GxUnitModelBase.h:418
GX_FORCE_INLINE u32 getPartsIndexMinimum(u32 index) const
パーツの最小のインデックスを取得
Definition GxUnitModelBase.h:533
GX_FORCE_INLINE void setPropertyModelResource(const void *const pValue)
モデルリソースを設定
Definition GxUnitModelBase.h:314
GxVector4 _instanceData
インスタンスのオプションデータ
Definition GxUnitModelBase.h:714
GX_FORCE_INLINE b32 isPartsFlag(u32 index) const
パーツフラグを取得
Definition GxUnitModelBase.h:505
b32 _usePartsMatrixFlag
パーツマトリクスを使用するかフラグ
Definition GxUnitModelBase.h:679
constexpr void setPropertyMaterialCount(u32)
マテリアル数を設定
Definition GxUnitModelBase.h:381
constexpr void setPropertyMaterialResourceCount(const void *const, u32)
マテリアルリソースを設定(プロパティ用)
Definition GxUnitModelBase.h:325
u32 * _pInstanceShowFlag
インスタンス表示カリングフラグ
Definition GxUnitModelBase.h:693
GX_FORCE_INLINE void * mapPartsIndexBuffer(u32 index, u32 mappingType)
パーツのインデックスバッファのマッピング開始
Definition GxUnitModelBase.h:191
GX_FORCE_INLINE void getPropertyInstanceQuaternion(void *const pValue, u32 index)
インスタンス回転を取得
Definition GxUnitModelBase.h:407
GX_FORCE_INLINE u32 getPropertyInstanceScaleCount(void)
インスタンススケール数を取得
Definition GxUnitModelBase.h:420
GX_FORCE_INLINE u32 getPropertyPartsFlagCount(void)
パーツフラグ数を取得
Definition GxUnitModelBase.h:352
GX_FORCE_INLINE void setPropertyMeshRenderFlagCount(u32 count)
メッシュ描画フラグ数を設定
Definition GxUnitModelBase.h:372
GX_FORCE_INLINE GxCriticalSection * getMaterialCriticalSection(void)
マテリアル構築に関わる処理に対するクリティカルセクション取得
Definition GxUnitModelBase.h:599
GxInstanceData * _pSaveInstanceDataArray
インスタンス用の保存領域
Definition GxUnitModelBase.h:704
GX_FORCE_INLINE b32 isMeshCullingFlag(u32 index, RENDER_VIEW view, CULLING_FRUSTUM pass) const
メッシュカリングフラグを取得
Definition GxUnitModelBase.h:546
GX_FORCE_INLINE void setPropertyInstanceCount(const void *const pValue)
インスタンス数を設定
Definition GxUnitModelBase.h:391
GxInstanceData * _pInstanceDataArray
インスタンス用の保存領域
Definition GxUnitModelBase.h:703
static GX_HANDLE _handleEnvironmentMapSampler
環境マップサンプラーハンドル
Definition GxUnitModelBase.h:745
GxMatrixAffine * _pJointMultiplyMatrix
ジョイントの乗算マトリクス
Definition GxUnitModelBase.h:684
static GX_HANDLE _handleLightParameter
ライトパラメータハンドル
Definition GxUnitModelBase.h:742
GX_FORCE_INLINE void setPropertyInstancePosition(const void *const pValue, u32 index)
インスタンス座標を設定
Definition GxUnitModelBase.h:396
GX_FORCE_INLINE void getPropertyModelResource(void *const pValue)
モデルリソースを取得
Definition GxUnitModelBase.h:316
GX_FORCE_INLINE b32 isModelAttribute(MODEL_ATTRIBUTE attribute) const
属性の取得
Definition GxUnitModelBase.h:558
static GX_HANDLE _handleProjectionMatrix
射影行列ハンドル
Definition GxUnitModelBase.h:740
GX_FORCE_INLINE void setPartsFlag(u32 index, b32 enable)
パーツフラグを設定
Definition GxUnitModelBase.h:507
GX_FORCE_INLINE u32 getPropertyMaterialCount(void)
マテリアル数を取得
Definition GxUnitModelBase.h:383
constexpr void setShowLod(GxResModel::LOD showLod)
表示LODの設定
Definition GxUnitModelBase.h:565
constexpr GxResModel::LOD getLodMode(void) const
LODモードの取得
Definition GxUnitModelBase.h:568
void updateWorldMatrix(void) override
ワールドマトリクスの更新
Definition GxUnitModelBase.cpp:393
static s32 commitVertexBufferData(void *pSource, void *pArgument)
頂点バッファの内容を更新
GX_FORCE_INLINE void setPropertyMeshRenderFlag(const void *const pValue, u32 index)
メッシュ描画フラグを設定
Definition GxUnitModelBase.h:368
GX_FORCE_INLINE u32 getMeshIndexFromPartsIndex(u32 partsIndex) const
パーツインデックスからメッシュインデックスを取得
Definition GxUnitModelBase.h:539
virtual GX_FORCE_INLINE GxResModel * getModelResource(void) const
モデルリソースを取得する
Definition GxUnitModelBase.h:176
GX_FORCE_INLINE void setPropertyMeshCullingFlagCount(u32 count)
メッシュカリングフラグ数を設定
Definition GxUnitModelBase.h:363
GX_FORCE_INLINE b32 isMeshRenderFlag(u32 index) const
メッシュ描画フラグを取得
Definition GxUnitModelBase.h:550
u32 _viewNum
フラグ確保されたビューの数
Definition GxUnitModelBase.h:681
GX_FORCE_INLINE void getPropertyInstanceOffsetMatrix(void *const pValue, u32 index)
インスタンスオフセットマトリクスを取得
Definition GxUnitModelBase.h:425
GX_FORCE_INLINE void getPropertyInstanceScale(void *const pValue, u32 index)
インスタンススケールを取得
Definition GxUnitModelBase.h:416
constexpr u32 getPropertyMaterialResourceCount(void)
マテリアルリソースを取得(プロパティ用)
Definition GxUnitModelBase.h:323
GxVector4 * _pRenderInstanceData
インスタンスの描画オプションデータ
Definition GxUnitModelBase.h:713
constexpr void setPropertyInstanceOffsetMatrixCount(u32)
インスタンスオフセットマトリクス数を設定
Definition GxUnitModelBase.h:427
constexpr u32 getMaterialCount(void) const
マテリアル数を取得
Definition GxUnitModelBase.h:553
u32 _renderInstanceCount
描画インスタンス数
Definition GxUnitModelBase.h:716
GX_FORCE_INLINE s32 getPartsIndex(GX_CSTR partsName) const
パーツインデックスを取得
Definition GxUnitModelBase.h:509
static GX_HANDLE _handleInverseScale
逆スケールハンドル
Definition GxUnitModelBase.h:744
u8 *** _pppInstanceCullingFlag8
インスタンスカリングフラグ
Definition GxUnitModelBase.h:689
GX_FORCE_INLINE void unmapPartsIndexBuffer(u32 index)
パーツのインデックスバッファのマッピング終了
Definition GxUnitModelBase.h:193
GX_FORCE_INLINE b32 isUsePartsMatrix(void)
パーツマトリクスを使用するか判定
Definition GxUnitModelBase.h:511
GxResMaterial ** _ppResMaterial
マテリアルリソース
Definition GxUnitModelBase.h:667
GxRenderVertexDeclaration ** _ppInstanceVertexDeclaration
インスタンス用頂点宣言
Definition GxUnitModelBase.h:717
GX_FORCE_INLINE void setPropertyPartsMatrix(const void *const pValue, u32 index)
パーツマトリクスを設定
Definition GxUnitModelBase.h:354
constexpr GxResMaterial * getMaterialResource(u32 index=0)
マテリアルリソースを取得
Definition GxUnitModelBase.h:178
GX_FORCE_INLINE u32 getPropertyMeshCullingFlagCount(void)
メッシュカリングフラグ数を取得
Definition GxUnitModelBase.h:365
GX_FORCE_INLINE void setPropertyInstanceOffsetMatrix(const void *const pValue, u32 index)
インスタンスオフセットマトリクスを設定
Definition GxUnitModelBase.h:423
GX_FORCE_INLINE void clearMeshRenderFlag(void)
メッシュ描画フラグをクリア
Definition GxUnitModelBase.h:268
u32 _reservedInstanceCount
メモリとして確保した配列数
Definition GxUnitModelBase.h:708
constexpr u32 getInstanceCount(void) const
インスタンスの個数取得
Definition GxUnitModelBase.h:579
GX_FORCE_INLINE b32 isInstanced(void) const
インスタンスされているか否かを返す
Definition GxUnitModelBase.h:587
GX_FORCE_INLINE void setPropertyInstanceQuaternionCount(u32 count)
インスタンス回転数を設定
Definition GxUnitModelBase.h:409
constexpr void setPropertyLODDistanceCount(const void *const, u32)
LOD数を設定
Definition GxUnitModelBase.h:334
MODEL_ATTRIBUTE
属性定義
Definition GxUnitModelBase.h:52
constexpr GxResModel::LOD getShowLod(void) const
表示LODの取得
Definition GxUnitModelBase.h:563
GX_FORCE_INLINE u32 getPropertyMeshRenderFlagCount(void)
メッシュ描画フラグ数を取得
Definition GxUnitModelBase.h:374
GX_FORCE_INLINE u32 getMeshGroupIndexFromMeshIndex(u32 meshIndex) const
メッシュインデックスからメッシュグループインデックスを取得
Definition GxUnitModelBase.h:541
GX_FORCE_INLINE b32 isInstanceShowFlag(u32 index) const
インスタンス表示フラグを取得
Definition GxUnitModelBase.h:628
GX_FORCE_INLINE void setPropertyMeshCullingFlag(const void *const, u32 index, u32 view, u32 pass)
メッシュカリングフラグを設定
Definition GxUnitModelBase.h:359
GX_FORCE_INLINE u32 getPropertyInstanceQuaternionCount(void)
インスタンス回転数を取得
Definition GxUnitModelBase.h:411
u32 * _pMeshRenderFlag
メッシュ描画フラグ
Definition GxUnitModelBase.h:691
GX_FORCE_INLINE void getPropertyJoint(void *const pValue, u32 index)
関節を取得
Definition GxUnitModelBase.h:339
GX_FORCE_INLINE void getPropertyMeshCullingFlag(void *const pValue, u32 index, u32 view, u32 pass)
メッシュカリングフラグを取得
Definition GxUnitModelBase.h:361
GxVector4 * _pInstanceData
インスタンスのオプションデータ
Definition GxUnitModelBase.h:712
u8 * _pMeshCullingFlag8Buffer
メッシュカリングフラグバッファ
Definition GxUnitModelBase.h:688
GX_FORCE_INLINE b32 isInstanceCullingFlag(u32 index, RENDER_VIEW view, u32 pass) const
インスタンスカリングフラグを取得
Definition GxUnitModelBase.h:632
GxMatrixAffine _renderViewMatrix
描画ビューマトリクス
Definition GxUnitModelBase.h:671
GX_FORCE_INLINE void getPropertyMaterialResource(void *const pValue, u32 index)
マテリアルリソースを取得(プロパティ用)
Definition GxUnitModelBase.h:319
constexpr u32 getMeshCullingFlagCount(void) const
メッシュカリングフラグ数を取得
Definition GxUnitModelBase.h:544
GX_FORCE_INLINE u32 getPropertyInstancePositionCount(void)
インスタンス座標数を取得
Definition GxUnitModelBase.h:402
u32 _defaultPartsFlag
初期パーツフラグ
Definition GxUnitModelBase.h:678
GX_FORCE_INLINE void getPropertyInstanceCount(void *const pValue)
インスタンス数を取得
Definition GxUnitModelBase.h:393
GX_FORCE_INLINE u32 getPartsVertexStride(u32 index, u16 vertexStream) const
パーツの頂点ストライドを取得
Definition GxUnitModelBase.h:524
GX_FORCE_INLINE RENDER_INDEX_TYPE getPartsIndexType(u32 index) const
パーツのインデックスタイプを取得
Definition GxUnitModelBase.h:527
GxResModel * _pResModel
モデルリソース
Definition GxUnitModelBase.h:666
GX_FORCE_INLINE u32 getPartsIndexOffset(u32 index) const
パーツのインデックスバッファオフセットを取得
Definition GxUnitModelBase.h:529
PASSINFO
パス情報
Definition GxUnitModelBase.h:39
GX_FORCE_INLINE void setPropertyInstancePositionCount(u32 count)
インスタンス座標数を設定
Definition GxUnitModelBase.h:400
static GX_HANDLE _handleInstanceData
インスタンスデータハンドル
Definition GxUnitModelBase.h:743
constexpr void setPropertyInstanceShowFlagCount(u32)
インスタンス表示数を設定
Definition GxUnitModelBase.h:447
u32 _instanceCount
インスタンス数
Definition GxUnitModelBase.h:715
GX_FORCE_INLINE void setUsePartsMatrix(b32 on)
パーツマトリクスを使用するか設定
Definition GxUnitModelBase.h:513
GxFlag32Index< MODEL_ATTRIBUTE > _modelAttribute
属性
Definition GxUnitModelBase.h:699
static b32 _isUsableShaderHandleBase
シェーダーハンドル使用可能フラグ
Definition GxUnitModelBase.h:739
GX_FORCE_INLINE u32 getPropertyInstanceOffsetMatrixCount(void)
インスタンスオフセットマトリクス数を取得
Definition GxUnitModelBase.h:429
GxJoint * _pJoint
関節
Definition GxUnitModelBase.h:664
GxResModel::LOD _lodMode
LODモード
Definition GxUnitModelBase.h:701
GxMatrixAffine _defaultPartsMatrix
初期パーツのマトリクス
Definition GxUnitModelBase.h:710
GxMatrixAffineGpu _defaultRenderMatrix
初期描画マトリクス
Definition GxUnitModelBase.h:674
GX_FORCE_INLINE u32 getPropertyInstanceShowFlagCount(void)
インスタンス表示数を取得
Definition GxUnitModelBase.h:449
GxMatrixAffine _defaultJointMultiplyMatrix
初期ジョイントの乗算マトリクス
Definition GxUnitModelBase.h:685
static GX_HANDLE _handleCubeMapSampler
キューブマップサンプラーハンドル
Definition GxUnitModelBase.h:746
GX_FORCE_INLINE void getPropertyPartsMatrix(void *const pValue, u32 index)
パーツマトリクスを取得
Definition GxUnitModelBase.h:356
constexpr u32 getMeshRenderFlagCount(void) const
メッシュ描画フラグ数を取得
Definition GxUnitModelBase.h:548
Definition GxColor.h:21
GX_FORCE_INLINE b32 isFlag(u32 flagIndex) const
フラグを判定
Definition GxStruct.h:1406
GX_FORCE_INLINE void setFlag(u32 flagIndex, b32 enable=true)
フラグを設定
Definition GxStruct.h:1403
GX_FORCE_INLINE void clear(void)
クリア
Definition GxStruct.h:1401
インデックス指定型フラグ
Definition GxStruct.h:1294
GX_FORCE_INLINE void setFlag(T index, b32 enable)
Definition GxStruct.h:1325
GX_FORCE_INLINE b32 isFlag(T index) const
フラグ直取得
Definition GxStruct.h:1321
モデルリソース関節構造体
Definition GxResModel.inl:70
4×4行列(行優先)
Definition GxMatrix.h:607
アフィン変換行列(GPU用)
Definition GxMatrix.h:874
アフィン変換行列(行優先)
Definition GxMatrix.h:330
GX_FORCE_INLINE void setPosition(const GxVector3 &position)
平行移動量のみを設定
Definition GxMatrix.inl:2141
クォータニオン
Definition GxQuaternion.h:19
モデルリソースメッシュグループ構造体
Definition GxResModel.h:211
シェーダコード
Definition GxShaderPackage.h:52
Definition GxBase.h:24
インスタンス情報
Definition GxUnitModelBase.h:92
GxQuaternion _quaternion
インスタンスの回転
Definition GxUnitModelBase.h:94
GxVector3 _position
インスタンスの座標
Definition GxUnitModelBase.h:93
GxMatrixAffine _matrix
インスタンスのマトリクス
Definition GxUnitModelBase.h:97
GxVector3 _scale
インスタンスのスケール
Definition GxUnitModelBase.h:95
GxMatrixAffine _offsetMatrix
インスタンスのオフセットマトリクス
Definition GxUnitModelBase.h:96
関節構造体
Definition GxUnitModelBase.h:795
constexpr void setParentJoint(GxJoint *pJoint)
親関節を設定
Definition GxUnitModelBase.h:880
GX_FORCE_INLINE void setInversMatrix(const GxMatrixAffine *pMatrix)
スキニング用逆マトリクスを取得
Definition GxUnitModelBase.h:909
constexpr void setChildJoint(GxJoint *pJoint)
子関節を設定
Definition GxUnitModelBase.h:884
constexpr u32 getIndex(void) const
インデックスを取得
Definition GxUnitModelBase.h:866
GX_FORCE_INLINE const GxMatrixAffine & getLocalMatrix(void) const
ローカルマトリクスを取得
Definition GxUnitModelBase.h:891
GX_FORCE_INLINE void setAttribute(ATTRIBUTE attribute, b32 enable)
属性の設定
Definition GxUnitModelBase.h:927
GX_FORCE_INLINE const GxMatrixAffine & getOrientMatrix(void) const
オリエントマトリクスを取得
Definition GxUnitModelBase.h:903
GX_FORCE_INLINE const GxVector3 & getScale(void) const
スケールの取得
Definition GxUnitModelBase.h:920
GX_FORCE_INLINE const GxQuaternion & getQuaternion(void) const
クォータニオンの取得
Definition GxUnitModelBase.h:916
constexpr GxJoint * getBrotherJoint(void) const
弟関節を取得
Definition GxUnitModelBase.h:886
GX_FORCE_INLINE b32 isAttribute(ATTRIBUTE attribute) const
属性の取得
Definition GxUnitModelBase.h:925
constexpr s32 getId(void) const
IDを取得
Definition GxUnitModelBase.h:870
constexpr GX_CSTR getName(void) const
名前を取得
Definition GxUnitModelBase.h:874
constexpr void setName(GX_CSTR name)
名前を設定
Definition GxUnitModelBase.h:876
constexpr void setIndex(u32 index)
インデックスを設定
Definition GxUnitModelBase.h:868
GX_FORCE_INLINE void setLocalMatrix(const GxMatrixAffine &localMatrix, const GxVector3 &offset)
ローカルマトリクスを設定
Definition GxUnitModelBase.h:895
GX_FORCE_INLINE const GxMatrixAffine & getInversMatrix(void) const
スキニング用逆マトリクスを取得
Definition GxUnitModelBase.h:907
constexpr void setBrotherJoint(GxJoint *pJoint)
弟関節を設定
Definition GxUnitModelBase.h:888
ATTRIBUTE
Definition GxUnitModelBase.h:807
@ SEGMENT_SCALE_COMPENSATE
親のスケールの影響を受けない
@ WORLD
ワールドに直接存在する
GX_FORCE_INLINE void setPosition(const GxVector3 &position)
座標の設定
Definition GxUnitModelBase.h:914
GX_FORCE_INLINE void setQuaternion(const GxQuaternion &quaternion)
クォータニオンの設定
Definition GxUnitModelBase.h:918
constexpr GxJoint * getChildJoint(void) const
子関節を取得
Definition GxUnitModelBase.h:882
GX_FORCE_INLINE const GxMatrixAffine & getWorldMatrix(void) const
ワールドマトリクスを取得
Definition GxUnitModelBase.h:898
GX_FORCE_INLINE void setScale(const GxVector3 &scale)
スケールの設定
Definition GxUnitModelBase.h:922
GX_FORCE_INLINE void setOrientMatrix(const GxMatrixAffine *pMatrix)
オリエントマトリクスを取得
Definition GxUnitModelBase.h:905
GX_FORCE_INLINE const GxVector3 & getPosition(void) const
座標の取得
Definition GxUnitModelBase.h:912
GX_FORCE_INLINE void setWorldMatrix(const GxMatrixAffine &worldMatrix)
ワールドマトリクスを設定
Definition GxUnitModelBase.h:900
constexpr void setId(s32 id)
IDを設定
Definition GxUnitModelBase.h:872
GX_FORCE_INLINE void setLocalMatrix(const GxMatrixAffine &localMatrix)
ローカルマトリクスを設定
Definition GxUnitModelBase.h:893
GxJoint(void)
デフォルトコンストラクタ
Definition GxUnitModelBase.cpp:3735
constexpr GxJoint * getParentJoint(void) const
親関節を取得
Definition GxUnitModelBase.h:878
void updateLocalMatrix(void)
ローカルマトリクスの更新
Definition GxUnitModelBase.cpp:3756
3次元ベクトル
Definition GxVector.h:245
4次元ベクトル
Definition GxVector.h:582
32bitブーリアン
Definition GxDefine.h:173