#include <XECustomPrimtive.h>
#include <XECustomPrimtive.h>
◆ AutoCalculateTangentDir()
自动计算顶点的Tangent方向(根据uv和position), 如有需要计算光照且顶点数据中没有切线方向数据时
- 返回
- void
◆ CreateMesh()
◆ GetAABB()
◆ GetComponent()
获取当前Primtive所依附的Component,通常情况是XECustomMeshComponent类型的Cmoponent
- 返回
- XEActorComponent 返回当前依附的Component
◆ GetMaterialIns()
◆ GetMeshByIndex()
◆ GetMeshesNum()
获取当前Mesh总数
- 返回
- number 返回当前Mesh总数
◆ IsInCameraClipSpace()
是否直接在相机的裁剪空间中渲染。
- 返回
- boolean
◆ new()
◆ RemoveMesh()
移除一个已经被创建的Mesh数据
- 参数
-
- 返回
- void
◆ SetInCameraClipSpace()
设置直接在相机的裁剪空间中渲染。此时会直接认为原点位于相机裁剪空间中的原点处
- 参数
-
- 返回
- void
◆ SetIndex()
设置顶点索引数据
- 参数
-
vIndices | number[] 顶点索引数组,每个索引的类型为xuint16 |
- 返回
- void
◆ SetMaterialIns() [1/2]
设置渲染时使用的材质实例,一般不会手动更改,默认的材质实例为渲染半透明模型的材质实例
- 参数
-
pMaterialIns | IXMaterialInstance |
bReleaseWhenDelted | boolean 当该Primtive被销毁时,是否需要帮忙释放pMaterialIns。如果不需要释放就传xfalse,需要就传xtrue |
- 返回
- void
◆ SetMaterialIns() [2/2]
function XECustomPrimtive SetMaterialIns |
( |
strMaterialTemp |
, |
|
|
bReleaseWhenDelted |
|
|
) |
| |
XECustomPrimtive_SetMaterialIns01
- 参数
-
strMaterialTemp | string |
bReleaseWhenDelted | boolean |
- 返回
- void
◆ SetMaterialNormal()
XECustomPrimtive_SetMaterialNormal00
- 返回
- void
◆ SetMaterialTextureByName()
function XECustomPrimtive SetMaterialTextureByName |
( |
strParamName |
, |
|
|
strTexturePath |
|
|
) |
| |
获取渲染时使用的材质实例,默认的材质实例为渲染半透明模型的材质实例
- 参数
-
strParamName | string 材质纹理参数 |
strTexturePath | string 材质纹理路径。纹理加载后,在该函数中引用将+1 |
- 返回
- void 返回当前使用的材质实例
◆ SetMaterialTextureInstanceByName()
function XECustomPrimtive SetMaterialTextureInstanceByName |
( |
strParamName |
, |
|
|
pTex |
|
|
) |
| |
获取渲染时使用的材质实例,默认的材质实例为渲染半透明模型的材质实例
- 参数
-
strParamName | string 材质纹理参数 |
pTex | IXTexture 纹理实例。该纹理实例在该函数中不会再添加引用。请在外部设置好引用 |
- 返回
- void 返回当前使用的材质实例
◆ SetMaterialTransparent()
XECustomPrimtive_SetMaterialTransparent00
- 返回
- void
◆ SetVertex()
◆ XECustomMeshVertex