From 369bf952f3430a5f392abccc0a2c4df1f3ae0c21 Mon Sep 17 00:00:00 2001 From: Jucan Daniel Date: Fri, 20 Oct 2023 16:10:36 +0300 Subject: [PATCH] feat(PxWorld,PxMesh): implement various APIs Co-authored-by: JaXt0r <120568393+JaXt0r@users.noreply.github.com> --- include/phoenix/cffi/Mesh.h | 17 +- include/phoenix/cffi/World.h | 172 +++++++++- src/Mesh.cc | 65 ++++ src/World.cc | 587 +++++++++++++++++++++++++++++++++++ 4 files changed, 838 insertions(+), 3 deletions(-) diff --git a/include/phoenix/cffi/Mesh.h b/include/phoenix/cffi/Mesh.h index f157097..9ab9720 100644 --- a/include/phoenix/cffi/Mesh.h +++ b/include/phoenix/cffi/Mesh.h @@ -4,6 +4,7 @@ #include "Api.h" #include "Buffer.h" #include "Material.h" +#include "Texture.h" #include "Vfs.h" #include @@ -15,7 +16,6 @@ typedef phoenix::mesh PxMesh; typedef struct PxInternal_Mesh PxMesh; #endif -// TODO: Lightmaps PXC_API PxMesh* pxMshLoad(PxBuffer* buffer); PXC_API PxMesh* pxMshLoadFromVfs(PxVfs const* vfs, char const* name); PXC_API void pxMshDestroy(PxMesh* msh); @@ -28,6 +28,21 @@ PXC_API uint32_t pxMshGetVertexCount(PxMesh const* msh); PXC_API PxVec3 pxMshGetVertex(PxMesh const* msh, uint32_t i); PXC_API uint32_t pxMshGetFeatureCount(PxMesh const* msh); PXC_API void pxMshGetFeature(PxMesh const* msh, uint32_t i, PxVec2* texture, uint32_t* light, PxVec3* normal); +PXC_API uint32_t pxMshGetLightMapCount(PxMesh const* msh); +// TODO: Lightmaps add normals vector +PXC_API void pxMshGetLightMap(PxMesh const* msh, uint32_t i, PxTexture const** image, PxVec3* origin); PXC_API uint32_t const* pxMshGetPolygonMaterialIndices(PxMesh const* msh, uint32_t* length); PXC_API uint32_t const* pxMshGetPolygonFeatureIndices(PxMesh const* msh, uint32_t* length); PXC_API uint32_t const* pxMshGetPolygonVertexIndices(PxMesh const* msh, uint32_t* length); +PXC_API int32_t const* pxMshGetPolygonLightMapIndices(PxMesh const* msh, uint32_t* length); +PXC_API uint32_t pxMshGetPolygonFlagCount(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetIsPortal(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetIsOccluder(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetIsSector(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetShouldRelight(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetIsOutdoor(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetIsGhostGccluder(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetIsDynamicallyLit(PxMesh const* msh, uint32_t i); +PXC_API int16_t pxMshGetPolygonFlagGetSector_Index(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetIsLod(PxMesh const* msh, uint32_t i); +PXC_API uint8_t pxMshGetPolygonFlagGetNormalAxis(PxMesh const* msh, uint32_t i); diff --git a/include/phoenix/cffi/World.h b/include/phoenix/cffi/World.h index 18a0fa9..ac6c449 100644 --- a/include/phoenix/cffi/World.h +++ b/include/phoenix/cffi/World.h @@ -150,6 +150,19 @@ typedef enum { PxVob_unknown = 45, } PxVobType; +typedef enum { + PxVobLightModePoint = 0, + PxVobLightModeSpot = 1, + PxVobLightModeReserved0 = 2, + PxVobLightModeReserved1 = 3, +} PxVobLightMode; + +typedef enum { + PxVobLightQualityHigh = 0, + PxVobLightQualityMedium = 1, + PxVobLightQualityLow = 2, +} PxVobLightQuality; + typedef enum { PxVobShadowNone = 0, PxVobShadowBlob = 1, @@ -291,11 +304,166 @@ PXC_API PxBool pxVobGetDecalIgnoreDaylight(PxVob const* vob); // TODO Vob - Camera +// Light Preset +PXC_API char const* pxLightPresetGetPreset(PxVobLightPreset const* lightPreset); +PXC_API PxVobLightMode pxLightPresetGetLightType(PxVobLightPreset const* lightPreset); +PXC_API float pxLightPresetGetRange(PxVobLightPreset const* lightPreset); +PXC_API PxColor pxLightPresetGetColor(PxVobLightPreset const* lightPreset); +PXC_API float pxLightPresetGetConeAngle(PxVobLightPreset const* lightPreset); +PXC_API PxBool pxLightPresetGetIsStatic(PxVobLightPreset const* lightPreset); +PXC_API PxVobLightQuality pxLightPresetGetQuality(PxVobLightPreset const* lightPreset); +PXC_API char const* pxLightPresetGetLensFlareFx(PxVobLight const* light); +PXC_API PxBool pxLightPresetGetOn(PxVobLightPreset const* lightPreset); +PXC_API uint32_t pxLightPresetGetRangeAnimationScaleCount(PxVobLightPreset const* lightPreset); +PXC_API float pxLightPresetGetRangeAnimationScale(PxVobLightPreset const* lightPreset, uint32_t i); +PXC_API float pxLightPresetGetRangeAnimationFps(PxVobLightPreset const* lightPreset); +PXC_API PxBool pxLightPresetGetRangeAnimationSmooth(PxVobLightPreset const* lightPreset); +PXC_API uint32_t pxLightPresetGetColorAnimationListCount(PxVobLightPreset const* lightPreset); +PXC_API PxColor pxLightPresetGetColorAnimationList(PxVobLightPreset const* lightPreset, uint32_t i); +PXC_API float pxLightPresetGetColorAnimationFps(PxVobLightPreset const* lightPreset); +PXC_API PxBool pxLightPresetGetColorAnimationSmooth(PxVobLightPreset const* lightPreset); +PXC_API PxBool pxLightPresetGetCanMove(PxVobLightPreset const* lightPreset); + +// Vob - Light +PXC_API char const* pxVobLightGetPreset(PxVobLight const* light); +PXC_API PxVobLightMode pxVobLightGetLightType(PxVobLight const* light); +PXC_API float pxVobLightGetRange(PxVobLight const* light); +PXC_API PxColor pxVobLightGetColor(PxVobLight const* light); +PXC_API float pxVobLightGetConeAngle(PxVobLight const* light); +PXC_API PxBool pxVobLightGetIsStatic(PxVobLight const* light); +PXC_API PxVobLightQuality pxVobLightGetQuality(PxVobLight const* light); +PXC_API char const* pxVobLightGetLensFlareFx(PxVobLight const* light); +PXC_API PxBool pxVobLightGetOn(PxVobLight const* light); +PXC_API uint32_t pxVobLightGetRangeAnimationScaleCount(PxVobLight const* light); +PXC_API float pxVobLightGetRangeAnimationScale(PxVobLight const* light, uint32_t i); +PXC_API float pxVobLightGetRangeAnimationFps(PxVobLight const* light); +PXC_API PxBool pxVobLightGetRangeAnimationSmooth(PxVobLight const* light); +PXC_API uint32_t pxVobLightGetColorAnimationListCount(PxVobLight const* light); +PXC_API PxColor pxVobLightGetColorAnimationList(PxVobLight const* light, uint32_t i); +PXC_API float pxVobLightGetColorAnimationFps(PxVobLight const* light); +PXC_API PxBool pxVobLightGetColorAnimationSmooth(PxVobLight const* light); +PXC_API PxBool pxVobLightGetCanMove(PxVobLight const* light); + +// Vob - Animate +PXC_API PxBool pxVobAnimateGetStartOn(PxVobAnimate const* animate); + // Vob - Item PXC_API char const* pxVobItemGetInstance(PxVobItem const* item); -// TODO Vob properties - Light -// TODO Vob properties - Misc +// Vob - Lens Flare +PXC_API char const* pxVobLensFlareGetFx(PxVobLensFlare const* lensFlare); + +// Vob - Pfx Controller +PXC_API char const* pxVobPfxControllerGetPfxName(PxVobPfxController const* pfxController); +PXC_API PxBool pxVobPfxControllerGetKillWhenDone(PxVobPfxController const* pfxController); +PXC_API PxBool pxVobPfxControllerGetInitiallyRunning(PxVobPfxController const* pfxController); + +// Vob - Message Filter +PXC_API char const* pxVobMessageFilterGetTarget(PxVobMessageFilter const* messageFilter); +PXC_API uint32_t pxVobMessageFilterGetOnTrigger(PxVobMessageFilter const* messageFilter); +PXC_API uint32_t pxVobMessageFilterGetOnUntrigger(PxVobMessageFilter const* messageFilter); + +// Vob - Code Master +PXC_API char const* pxVobCodeMasterGetTarget(PxVobCodeMaster const* codeMaster); +PXC_API PxBool pxVobCodeMasterGetOrdered(PxVobCodeMaster const* codeMaster); +PXC_API PxBool pxVobCodeMasterGetFirstFalseIsFailure(PxVobCodeMaster const* codeMaster); +PXC_API char const* pxVobCodeMasterGetFailureTarget(PxVobCodeMaster const* codeMaster); +PXC_API PxBool pxVobCodeMasterGetUntriggeredCancels(PxVobCodeMaster const* codeMaster); +PXC_API uint32_t pxVobCodeMasterGetSlavesCount(PxVobCodeMaster const* codeMaster); +PXC_API char const* pxVobCodeMasterGetSlaves(PxVobCodeMaster const* codeMaster, uint32_t i); + +// Vob - Mover Controller +PXC_API char const* pxVobMoverControllerGetTarget(PxVobMoverController const* moverController); +PXC_API uint32_t pxVobMoverControllerGetMessage(PxVobMoverController const* moverController); +PXC_API int32_t pxVobMoverControllerGetKey(PxVobMoverController const* moverController); + +// Vob - Touch Damage +PXC_API float pxVobTouchDamageGetDamage(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetBarrier(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetBlunt(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetEdge(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetFire(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetFly(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetMagic(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetPoint(PxVobTouchDamage const* touchDamage); +PXC_API PxBool pxVobTouchDamageGetFall(PxVobTouchDamage const* touchDamage); +PXC_API float pxVobTouchDamageGetRepearDelaySec(PxVobTouchDamage const* touchDamage); +PXC_API float pxVobTouchDamageGetVolumeScale(PxVobTouchDamage const* touchDamage); +PXC_API uint32_t pxVobTouchDamageGetCollision(PxVobTouchDamage const* touchDamage); + +// Vob - Earthquake +PXC_API float pxVobEarthquakeGetRadius(PxVobEarthquake const* earthquake); +PXC_API float pxVobEarthquakeGetDuration(PxVobEarthquake const* earthquake); +PXC_API PxVec3 pxVobEarthquakeGetAmplitude(PxVobEarthquake const* earthquake); + +// Vob - Npc +PXC_API char const* pxVobNpcGetNpcInstance(PxVobNpc const* npc); +PXC_API PxVec3 pxVobNpcGetModelScale(PxVobNpc const* npc); +PXC_API float pxVobNpcGetModelFatness(PxVobNpc const* npc); +PXC_API uint32_t pxVobNpcGetOverlaysCount(PxVobNpc const* npc); +PXC_API char const* pxVobNpcGetOverlays(PxVobNpc const* npc, uint32_t i); +PXC_API int pxVobNpcGetFlags(PxVobNpc const* npc); +PXC_API int pxVobNpcGetGuild(PxVobNpc const* npc); +PXC_API int pxVobNpcGetGuildTrue(PxVobNpc const* npc); +PXC_API int pxVobNpcGetLevel(PxVobNpc const* npc); +PXC_API int pxVobNpcGetXp(PxVobNpc const* npc); +PXC_API int pxVobNpcGetXpNextLevel(PxVobNpc const* npc); +PXC_API int pxVobNpcGetLp(PxVobNpc const* npc); +PXC_API uint32_t pxVobNpcGetTalentsCount(PxVobNpc const* npc); +PXC_API void pxVobNpcGetTalents(PxVobNpc const* npc, uint32_t i, int* talent, int* value, int* skill); +PXC_API int pxVobNpcGetFightTactic(PxVobNpc const* npc); +PXC_API int pxVobNpcGetFightMode(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetWounded(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetMad(PxVobNpc const* npc); +PXC_API int pxVobNpcGetMadTime(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetPlayer(PxVobNpc const* npc); +PXC_API uint32_t pxVobNpcGetAttributesCount(PxVobNpc const* npc); +PXC_API int pxVobNpcGetAttributes(PxVobNpc const* npc, uint32_t i); +PXC_API uint32_t pxVobNpcGetHcsCount(PxVobNpc const* npc); +PXC_API int pxVobNpcGetHcs(PxVobNpc const* npc, uint32_t i); +PXC_API uint32_t pxVobNpcGetMissionsCount(PxVobNpc const* npc); +PXC_API int pxVobNpcGetMissions(PxVobNpc const* npc, uint32_t i); +PXC_API char const* pxVobNpcGetStartAiState(PxVobNpc const* npc); +PXC_API uint32_t pxVobNpcGetAivarCount(PxVobNpc const* npc); +PXC_API int pxVobNpcGetAivar(PxVobNpc const* npc, uint32_t i); +PXC_API char const* pxVobNpcGetScriptWaypoint(PxVobNpc const* npc); +PXC_API int pxVobNpcGetAttitude(PxVobNpc const* npc); +PXC_API int pxVobNpcGetAttitudeTemp(PxVobNpc const* npc); +PXC_API int pxVobNpcGetNameNr(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetMoveLock(PxVobNpc const* npc); +PXC_API uint32_t pxVobNpcGetPackedCount(PxVobNpc const* npc); +PXC_API char const* pxVobNpcGetPacked(PxVobNpc const* npc, uint32_t i); +PXC_API uint32_t pxVobNpcGetItemsCount(PxVobNpc const* npc); +PXC_API PxVobItem const* pxVobNpcGetItems(PxVobNpc const* npc, uint32_t i); +PXC_API uint32_t pxVobNpcGetSlotsCount(PxVobNpc const* npc); +PXC_API void +pxVobNpcGetSlots(PxVobNpc const* npc, uint32_t i, PxBool* used, char const** name, int* itemIndex, PxBool* inInventory); +PXC_API PxBool pxVobNpcGetCurrentStateValid(PxVobNpc const* npc); +PXC_API char const* pxVobNpcGetCurrentStateName(PxVobNpc const* npc); +PXC_API int pxVobNpcGetCurrentStateIndex(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetCurrentStateIsRoutine(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetNextStateValid(PxVobNpc const* npc); +PXC_API char const* pxVobNpcGetNextStateName(PxVobNpc const* npc); +PXC_API int pxVobNpcGetNextStateIndex(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetNextStateIsRoutine(PxVobNpc const* npc); +PXC_API int pxVobNpcGetLastAiState(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetHasRoutine(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetRoutineChanged(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetRoutineOverlay(PxVobNpc const* npc); +PXC_API int pxVobNpcGetRoutineOverlayCount(PxVobNpc const* npc); +PXC_API int pxVobNpcGetWalkmodeRoutine(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetWeaponmodeRoutine(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetStartNewRoutine(PxVobNpc const* npc); +PXC_API int pxVobNpcGetAiStateDriven(PxVobNpc const* npc); +PXC_API PxVec3 pxVobNpcGetAiStatePos(PxVobNpc const* npc); +PXC_API char const* pxVobNpcGetCurrentRoutine(PxVobNpc const* npc); +PXC_API PxBool pxVobNpcGetRespawn(PxVobNpc const* npc); +PXC_API int pxVobNpcGetRespawnTime(PxVobNpc const* npc); +PXC_API uint32_t pxVobNpcGetProtectionCount(PxVobNpc const* npc); +PXC_API int pxVobNpcGetProtection(PxVobNpc const* npc, uint32_t i); +PXC_API int pxVobNpcGetBsInterruptableOverride(PxVobNpc const* npc); +PXC_API int pxVobNpcGetNpcType(PxVobNpc const* npc); +PXC_API int pxVobNpcGetSpellMana(PxVobNpc const* npc); // Vob - Mob PXC_API char const* pxVobMobGetName(PxVobMob const* mob); diff --git a/src/Mesh.cc b/src/Mesh.cc index bc37220..3266e95 100644 --- a/src/Mesh.cc +++ b/src/Mesh.cc @@ -76,6 +76,21 @@ void pxMshGetFeature(PxMesh const* msh, uint32_t i, PxVec2* texture, uint32_t* l normal->y = ft.normal.y; normal->z = ft.normal.z; } +uint32_t pxMshGetLightMapCount(PxMesh const* msh) { + return (uint32_t) msh->lightmaps.size(); +} +void pxMshGetLightMap(PxMesh const* msh, uint32_t i, PxTexture const** image, PxVec3* origin) { + auto& lm = msh->lightmaps[i]; + + // PxVec3 normal[] = { + // {lm.normals[0].x, lm.normals[0].y, lm.normals[0].z}, + // {lm.normals[1].x, lm.normals[1].y, lm.normals[1].z}, + // }; + + *image = lm.image.get(); + // *normals = normal; + *origin = PxVec3 {lm.origin.x, lm.origin.y, lm.origin.z}; +} uint32_t const* pxMshGetPolygonMaterialIndices(PxMesh const* msh, uint32_t* length) { auto& polys = msh->polygons; @@ -94,3 +109,53 @@ uint32_t const* pxMshGetPolygonVertexIndices(PxMesh const* msh, uint32_t* length *length = (uint32_t) polys.vertex_indices.size(); return polys.vertex_indices.data(); } + +int32_t const* pxMshGetPolygonLightMapIndices(PxMesh const* msh, uint32_t* length) { + auto& polys = msh->polygons; + *length = (uint32_t) polys.lightmap_indices.size(); + return polys.lightmap_indices.data(); +} + +uint32_t pxMshGetPolygonFlagCount(PxMesh const* msh) { + return (uint32_t) msh->polygons.flags.size(); +} + +uint8_t pxMshGetPolygonFlagGetIsPortal(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].is_portal; +} + +uint8_t pxMshGetPolygonFlagGetIsOccluder(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].is_occluder; +} + +uint8_t pxMshGetPolygonFlagGetIsSector(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].is_sector; +} + +uint8_t pxMshGetPolygonFlagGetShouldRelight(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].should_relight; +} + +uint8_t pxMshGetPolygonFlagGetIsOutdoor(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].is_outdoor; +} + +uint8_t pxMshGetPolygonFlagGetIsGhostGccluder(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].is_ghost_occluder; +} + +uint8_t pxMshGetPolygonFlagGetIsDynamicallyLit(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].is_dynamically_lit; +} + +int16_t pxMshGetPolygonFlagGetSector_Index(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].sector_index; +} + +uint8_t pxMshGetPolygonFlagGetIsLod(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].is_lod; +} + +uint8_t pxMshGetPolygonFlagGetNormalAxis(PxMesh const* msh, uint32_t i) { + return msh->polygons.flags[i].normal_axis; +} diff --git a/src/World.cc b/src/World.cc index 674dc4d..f2cd4a8 100644 --- a/src/World.cc +++ b/src/World.cc @@ -227,11 +227,598 @@ PxBool pxVobGetDecalIgnoreDaylight(PxVob const* vob) { return vob->visual_decal->ignore_daylight; } +// Light Preset +char const* pxLightPresetGetPreset(PxVobLightPreset const* lightPreset) { + return lightPreset->preset.c_str(); +} + +PxVobLightMode pxLightPresetGetLightType(PxVobLightPreset const* lightPreset) { + return static_cast(lightPreset->light_type); +} + +float pxLightPresetGetRange(PxVobLightPreset const* lightPreset) { + return lightPreset->range; +} + +PxColor pxLightPresetGetColor(PxVobLightPreset const* lightPreset) { + PxColor color; + color.r = lightPreset->color.r; + color.g = lightPreset->color.g; + color.b = lightPreset->color.b; + color.a = lightPreset->color.a; + return color; +} + +float pxLightPresetGetConeAngle(PxVobLightPreset const* lightPreset) { + return lightPreset->cone_angle; +} + +PxBool pxLightPresetGetIsStatic(PxVobLightPreset const* lightPreset) { + return lightPreset->is_static; +} + +PxVobLightQuality pxLightPresetGetQuality(PxVobLightPreset const* lightPreset) { + return static_cast(lightPreset->quality); +} + +char const* pxLightPresetGetLensFlareFx(PxVobLight const* light) { + return light->lensflare_fx.c_str(); +} + +PxBool pxLightPresetGetOn(PxVobLightPreset const* lightPreset) { + return lightPreset->on; +} + +uint32_t pxLightPresetGetRangeAnimationScaleCount(PxVobLightPreset const* lightPreset) { + return (uint32_t) lightPreset->range_animation_scale.size(); +} + +float pxLightPresetGetRangeAnimationScale(PxVobLightPreset const* lightPreset, uint32_t i) { + return lightPreset->range_animation_scale[i]; +} + +float pxLightPresetGetRangeAnimationFps(PxVobLightPreset const* lightPreset) { + return lightPreset->range_animation_fps; +} + +PxBool pxLightPresetGetRangeAnimationSmooth(PxVobLightPreset const* lightPreset) { + return lightPreset->range_animation_smooth; +} + +uint32_t pxLightPresetGetColorAnimationListCount(PxVobLightPreset const* lightPreset) { + return (uint32_t) lightPreset->color_animation_list.size(); +} + +PxColor pxLightPresetGetColorAnimationList(PxVobLightPreset const* lightPreset, uint32_t i) { + PxColor color; + color.r = lightPreset->color_animation_list[i].r; + color.g = lightPreset->color_animation_list[i].g; + color.b = lightPreset->color_animation_list[i].b; + color.a = lightPreset->color_animation_list[i].a; + return color; +} + +float pxLightPresetGetColorAnimationFps(PxVobLightPreset const* lightPreset) { + return lightPreset->color_animation_fps; +} + +PxBool pxLightPresetGetColorAnimationSmooth(PxVobLightPreset const* lightPreset) { + return lightPreset->color_animation_smooth; +} + +PxBool pxLightPresetGetCanMove(PxVobLightPreset const* lightPreset) { + return lightPreset->can_move; +} +// Vob - Light +char const* pxVobLightGetPreset(PxVobLight const* light) { + return light->preset.c_str(); +} + +PxVobLightMode pxVobLightGetLightType(PxVobLight const* light) { + return static_cast(light->light_type); +} + +float pxVobLightGetRange(PxVobLight const* light) { + return light->range; +} + +PxColor pxVobLightGetColor(PxVobLight const* light) { + PxColor color; + color.r = light->color.r; + color.g = light->color.g; + color.b = light->color.b; + color.a = light->color.a; + return color; +} + +float pxVobLightGetConeAngle(PxVobLight const* light) { + return light->cone_angle; +} + +PxBool pxVobLightGetIsStatic(PxVobLight const* light) { + return light->is_static; +} + +PxVobLightQuality pxVobLightGetQuality(PxVobLight const* light) { + return static_cast(light->quality); +} + +char const* pxVobLightGetLensFlareFx(PxVobLight const* light) { + return light->lensflare_fx.c_str(); +} + +PxBool pxVobLightGetOn(PxVobLight const* light) { + return light->on; +} + +uint32_t pxVobLightGetRangeAnimationScaleCount(PxVobLight const* light) { + return (uint32_t) light->range_animation_scale.size(); +} + +float pxVobLightGetRangeAnimationScale(PxVobLight const* light, uint32_t i) { + return light->range_animation_scale[i]; +} + +float pxVobLightGetRangeAnimationFps(PxVobLight const* light) { + return light->range_animation_fps; +} + +PxBool pxVobLightGetRangeAnimationSmooth(PxVobLight const* light) { + return light->range_animation_smooth; +} + +uint32_t pxVobLightGetColorAnimationListCount(PxVobLight const* light) { + return (uint32_t) light->color_animation_list.size(); +} + +PxColor pxVobLightGetColorAnimationList(PxVobLight const* light, uint32_t i) { + PxColor color; + color.r = light->color_animation_list[i].r; + color.g = light->color_animation_list[i].g; + color.b = light->color_animation_list[i].b; + color.a = light->color_animation_list[i].a; + return color; +} + +float pxVobLightGetColorAnimationFps(PxVobLight const* light) { + return light->color_animation_fps; +} + +PxBool pxVobLightGetColorAnimationSmooth(PxVobLight const* light) { + return light->color_animation_smooth; +} + +PxBool pxVobLightGetCanMove(PxVobLight const* light) { + return light->can_move; +} + +// Vob - Animate +PxBool pxVobAnimateGetStartOn(PxVobAnimate const* animate) { + return animate->start_on; +} + // Vob - Item char const* pxVobItemGetInstance(PxVobItem const* item) { return item->instance.c_str(); } +// Vob - Lens Flare +char const* pxVobLensFlareGetFx(PxVobLensFlare const* lensFlare) { + return lensFlare->fx.c_str(); +} + +// Vob - Pfx Controller +char const* pxVobPfxControllerGetPfxName(PxVobPfxController const* pfxController) { + return pfxController->pfx_name.c_str(); +} + +PxBool pxVobPfxControllerGetKillWhenDone(PxVobPfxController const* pfxController) { + return pfxController->kill_when_done; +} + +PxBool pxVobPfxControllerGetInitiallyRunning(PxVobPfxController const* pfxController) { + return pfxController->initially_running; +} + +// Vob - Message Filter +char const* pxVobMessageFilterGetTarget(PxVobMessageFilter const* messageFilter) { + return messageFilter->target.c_str(); +} + +uint32_t pxVobMessageFilterGetOnTrigger(PxVobMessageFilter const* messageFilter) { + return (uint32_t) messageFilter->on_trigger; +} + +uint32_t pxVobMessageFilterGetOnUntrigger(PxVobMessageFilter const* messageFilter) { + return (uint32_t) messageFilter->on_untrigger; +} + +// Vob - Code Master +char const* pxVobCodeMasterGetTarget(PxVobCodeMaster const* codeMaster) { + return codeMaster->target.c_str(); +} + +PxBool pxVobCodeMasterGetOrdered(PxVobCodeMaster const* codeMaster) { + return codeMaster->ordered; +} + +PxBool pxVobCodeMasterGetFirstFalseIsFailure(PxVobCodeMaster const* codeMaster) { + return codeMaster->first_false_is_failure; +} + +char const* pxVobCodeMasterGetFailureTarget(PxVobCodeMaster const* codeMaster) { + return codeMaster->failure_target.c_str(); +} + +PxBool pxVobCodeMasterGetUntriggeredCancels(PxVobCodeMaster const* codeMaster) { + return codeMaster->untriggered_cancels; +} + +uint32_t pxVobCodeMasterGetSlavesCount(PxVobCodeMaster const* codeMaster) { + return (uint32_t) codeMaster->slaves.size(); +} + +char const* pxVobCodeMasterGetSlaves(PxVobCodeMaster const* codeMaster, uint32_t i) { + return codeMaster->slaves[i].c_str(); +} + +// Vob - Mover Controller +char const* pxVobMoverControllerGetTarget(PxVobMoverController const* moverController) { + return moverController->target.c_str(); +} + +uint32_t pxVobMoverControllerGetMessage(PxVobMoverController const* moverController) { + return (uint32_t) moverController->message; +} + +int32_t pxVobMoverControllerGetKey(PxVobMoverController const* moverController) { + return moverController->key; +} + +// Vob - Touch Damage +float pxVobTouchDamageGetDamage(PxVobTouchDamage const* touchDamage) { + return touchDamage->damage; +} + +PxBool pxVobTouchDamageGetBarrier(PxVobTouchDamage const* touchDamage) { + return touchDamage->barrier; +} + +PxBool pxVobTouchDamageGetBlunt(PxVobTouchDamage const* touchDamage) { + return touchDamage->blunt; +} + +PxBool pxVobTouchDamageGetEdge(PxVobTouchDamage const* touchDamage) { + return touchDamage->edge; +} + +PxBool pxVobTouchDamageGetFire(PxVobTouchDamage const* touchDamage) { + return touchDamage->fire; +} + +PxBool pxVobTouchDamageGetFly(PxVobTouchDamage const* touchDamage) { + return touchDamage->fly; +} + +PxBool pxVobTouchDamageGetMagic(PxVobTouchDamage const* touchDamage) { + return touchDamage->magic; +} + +PxBool pxVobTouchDamageGetPoint(PxVobTouchDamage const* touchDamage) { + return touchDamage->point; +} + +PxBool pxVobTouchDamageGetFall(PxVobTouchDamage const* touchDamage) { + return touchDamage->fall; +} + +float pxVobTouchDamageGetRepearDelaySec(PxVobTouchDamage const* touchDamage) { + return touchDamage->repeat_delay_sec; +} + +float pxVobTouchDamageGetVolumeScale(PxVobTouchDamage const* touchDamage) { + return touchDamage->volume_scale; +} + +uint32_t pxVobTouchDamageGetCollision(PxVobTouchDamage const* touchDamage) { + return (uint32_t) touchDamage->collision; +} + +// Vob - Earthquake +float pxVobEarthquakeGetRadius(PxVobEarthquake const* earthquake) { + return earthquake->radius; +} + +float pxVobEarthquakeGetDuration(PxVobEarthquake const* earthquake) { + return earthquake->duration; +} + +PxVec3 pxVobEarthquakeGetAmplitude(PxVobEarthquake const* earthquake) { + PxVec3 amplitude; + amplitude.x = earthquake->amplitude.x; + amplitude.y = earthquake->amplitude.y; + amplitude.z = earthquake->amplitude.z; + return amplitude; +} + +// Vob - Npc +char const* pxVobNpcGetNpcInstance(PxVobNpc const* npc) { + return npc->npc_instance.c_str(); +} + +PxVec3 pxVobNpcGetModelScale(PxVobNpc const* npc) { + PxVec3 scale; + scale.x = npc->model_scale.x; + scale.y = npc->model_scale.y; + scale.z = npc->model_scale.z; + return scale; +} + +float pxVobNpcGetModelFatness(PxVobNpc const* npc) { + return npc->model_fatness; +} + +uint32_t pxVobNpcGetOverlaysCount(PxVobNpc const* npc) { + return (uint32_t) npc->overlays.size(); +} + +char const* pxVobNpcGetOverlays(PxVobNpc const* npc, uint32_t i) { + return npc->overlays[i].c_str(); +} + +int pxVobNpcGetFlags(PxVobNpc const* npc) { + return npc->flags; +} + +int pxVobNpcGetGuild(PxVobNpc const* npc) { + return npc->guild; +} + +int pxVobNpcGetGuildTrue(PxVobNpc const* npc) { + return npc->guild_true; +} + +int pxVobNpcGetLevel(PxVobNpc const* npc) { + return npc->level; +} + +int pxVobNpcGetXp(PxVobNpc const* npc) { + return npc->xp; +} + +int pxVobNpcGetXpNextLevel(PxVobNpc const* npc) { + return npc->xp_next_level; +} + +int pxVobNpcGetLp(PxVobNpc const* npc) { + return npc->lp; +} + +uint32_t pxVobNpcGetTalentsCount(PxVobNpc const* npc) { + return (uint32_t) npc->talents.size(); +} + +void pxVobNpcGetTalents(PxVobNpc const* npc, uint32_t i, int* talent, int* value, int* skill) { + *talent = npc->talents[i].talent; + *value = npc->talents[i].value; + *skill = npc->talents[i].skill; +} + +int pxVobNpcGetFightTactic(PxVobNpc const* npc) { + return npc->fight_tactic; +} + +int pxVobNpcGetFightMode(PxVobNpc const* npc) { + return npc->fight_mode; +} + +PxBool pxVobNpcGetWounded(PxVobNpc const* npc) { + return npc->wounded; +} + +PxBool pxVobNpcGetMad(PxVobNpc const* npc) { + return npc->mad; +} + +int pxVobNpcGetMadTime(PxVobNpc const* npc) { + return npc->mad_time; +} + +PxBool pxVobNpcGetPlayer(PxVobNpc const* npc) { + return npc->player; +} + +uint32_t pxVobNpcGetAttributesCount(PxVobNpc const* npc) { + return npc->attribute_count; +} +int pxVobNpcGetAttributes(PxVobNpc const* npc, uint32_t i) { + return npc->attributes[i]; +} + +uint32_t pxVobNpcGetHcsCount(PxVobNpc const* npc) { + return npc->hcs_count; +} +int pxVobNpcGetHcs(PxVobNpc const* npc, uint32_t i) { + return npc->hcs[i]; +} + +uint32_t pxVobNpcGetMissionsCount(PxVobNpc const* npc) { + return npc->missions_count; +} + +int pxVobNpcGetMissions(PxVobNpc const* npc, uint32_t i) { + return npc->missions[i]; +} + +char const* pxVobNpcGetStartAiState(PxVobNpc const* npc) { + return npc->start_ai_state.c_str(); +} + +uint32_t pxVobNpcGetAivarCount(PxVobNpc const* npc) { + return npc->aivar_count; +} +int pxVobNpcGetAivar(PxVobNpc const* npc, uint32_t i) { + return npc->aivar[i]; +} + +char const* pxVobNpcGetScriptWaypoint(PxVobNpc const* npc) { + return npc->script_waypoint.c_str(); +} + +int pxVobNpcGetAttitude(PxVobNpc const* npc) { + return npc->attitude; +} + +int pxVobNpcGetAttitudeTemp(PxVobNpc const* npc) { + return npc->attitude_temp; +} + +int pxVobNpcGetNameNr(PxVobNpc const* npc) { + return npc->name_nr; +} + +PxBool pxVobNpcGetMoveLock(PxVobNpc const* npc) { + return npc->move_lock; +} + +uint32_t pxVobNpcGetPackedCount(PxVobNpc const* npc) { + return npc->packed_count; +} +char const* pxVobNpcGetPacked(PxVobNpc const* npc, uint32_t i) { + return npc->packed[i].c_str(); +} + +uint32_t pxVobNpcGetItemsCount(PxVobNpc const* npc) { + return (uint32_t) npc->items.size(); +} + +PxVobItem const* pxVobNpcGetItems(PxVobNpc const* npc, uint32_t i) { + return npc->items[i].get(); +} + +uint32_t pxVobNpcGetSlotsCount(PxVobNpc const* npc) { + return (uint32_t) npc->slots.size(); +} + +void pxVobNpcGetSlots(PxVobNpc const* npc, + uint32_t i, + PxBool* used, + char const** name, + int* itemIndex, + PxBool* inInventory) { + *used = npc->slots[i].used; + *name = npc->slots[i].name.c_str(); + *itemIndex = npc->slots[i].item_index; + *inInventory = npc->slots[i].in_inventory; +} + +PxBool pxVobNpcGetCurrentStateValid(PxVobNpc const* npc) { + return npc->current_state_valid; +} + +char const* pxVobNpcGetCurrentStateName(PxVobNpc const* npc) { + return npc->current_state_name.c_str(); +} + +int pxVobNpcGetCurrentStateIndex(PxVobNpc const* npc) { + return npc->current_state_index; +} + +PxBool pxVobNpcGetCurrentStateIsRoutine(PxVobNpc const* npc) { + return npc->current_state_is_routine; +} + +PxBool pxVobNpcGetNextStateValid(PxVobNpc const* npc) { + return npc->next_state_valid; +} + +char const* pxVobNpcGetNextStateName(PxVobNpc const* npc) { + return npc->next_state_name.c_str(); +} + +int pxVobNpcGetNextStateIndex(PxVobNpc const* npc) { + return npc->next_state_index; +} + +PxBool pxVobNpcGetNextStateIsRoutine(PxVobNpc const* npc) { + return npc->next_state_is_routine; +} + +int pxVobNpcGetLastAiState(PxVobNpc const* npc) { + return npc->last_ai_state; +} + +PxBool pxVobNpcGetHasRoutine(PxVobNpc const* npc) { + return npc->has_routine; +} + +PxBool pxVobNpcGetRoutineChanged(PxVobNpc const* npc) { + return npc->routine_changed; +} + +PxBool pxVobNpcGetRoutineOverlay(PxVobNpc const* npc) { + return npc->routine_overlay; +} + +int pxVobNpcGetRoutineOverlayCount(PxVobNpc const* npc) { + return npc->routine_overlay_count; +} + +int pxVobNpcGetWalkmodeRoutine(PxVobNpc const* npc) { + return npc->walkmode_routine; +} + +PxBool pxVobNpcGetWeaponmodeRoutine(PxVobNpc const* npc) { + return npc->weaponmode_routine; +} + +PxBool pxVobNpcGetStartNewRoutine(PxVobNpc const* npc) { + return npc->start_new_routine; +} + +int pxVobNpcGetAiStateDriven(PxVobNpc const* npc) { + return npc->ai_state_driven; +} + +PxVec3 pxVobNpcGetAiStatePos(PxVobNpc const* npc) { + PxVec3 ai_state_pos; + ai_state_pos.x = npc->ai_state_pos.x; + ai_state_pos.y = npc->ai_state_pos.y; + ai_state_pos.z = npc->ai_state_pos.z; + return ai_state_pos; +} + +char const* pxVobNpcGetCurrentRoutine(PxVobNpc const* npc) { + return npc->current_routine.c_str(); +} + +PxBool pxVobNpcGetRespawn(PxVobNpc const* npc) { + return npc->respawn; +} + +int pxVobNpcGetRespawnTime(PxVobNpc const* npc) { + return npc->respawn_time; +} + +uint32_t pxVobNpcGetProtectionCount(PxVobNpc const* npc) { + return npc->protection_count; +} +int pxVobNpcGetProtection(PxVobNpc const* npc, uint32_t i) { + return npc->protection[i]; +} + +int pxVobNpcGetBsInterruptableOverride(PxVobNpc const* npc) { + return npc->bs_interruptable_override; +} + +int pxVobNpcGetNpcType(PxVobNpc const* npc) { + return npc->npc_type; +} + +int pxVobNpcGetSpellMana(PxVobNpc const* npc) { + return npc->spell_mana; +} + // Vob - Mob char const* pxVobMobGetName(PxVobMob const* mob) { return mob->name.c_str();