another big refactor: wiLoader -> wiSceneComponents with proper namespace

This commit is contained in:
turanszkij
2018-08-18 15:03:25 +01:00
parent 7d48089234
commit 03dccc024b
63 changed files with 714 additions and 609 deletions
+1
View File
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "AnimationWindow.h"
using namespace wiSceneComponents;
AnimationWindow::AnimationWindow(wiGUI* gui) :GUI(gui)
{
+7 -3
View File
@@ -1,6 +1,10 @@
#pragma once
struct Armature;
namespace wiSceneComponents
{
struct Armature;
}
class wiGUI;
class wiWindow;
class wiLabel;
@@ -15,8 +19,8 @@ public:
~AnimationWindow();
wiGUI* GUI;
Armature* armature;
void SetArmature(Armature* armature);
wiSceneComponents::Armature* armature;
void SetArmature(wiSceneComponents::Armature* armature);
wiWindow* animWindow;
wiComboBox* actionsComboBox;
+2
View File
@@ -1,6 +1,8 @@
#include "stdafx.h"
#include "CameraWindow.h"
using namespace wiSceneComponents;
void CameraWindow::ResetCam()
{
wiRenderer::getCamera()->Clear();
+9 -4
View File
@@ -1,6 +1,11 @@
#pragma once
struct Material;
namespace wiSceneComponents
{
struct Camera;
struct Transform;
}
class wiGUI;
class wiWindow;
class wiLabel;
@@ -16,10 +21,10 @@ public:
void ResetCam();
Camera* proxy = nullptr;
void SetProxy(Camera* camera);
wiSceneComponents::Camera* proxy = nullptr;
void SetProxy(wiSceneComponents::Camera* camera);
Transform* orbitalCamTarget;
wiSceneComponents::Transform* orbitalCamTarget;
wiGUI* GUI;
+2
View File
@@ -1,6 +1,8 @@
#include "stdafx.h"
#include "DecalWindow.h"
using namespace wiSceneComponents;
DecalWindow::DecalWindow(wiGUI* gui) : GUI(gui)
{
+7 -5
View File
@@ -1,14 +1,16 @@
#pragma once
struct Material;
namespace wiSceneComponents
{
struct Decal;
}
class wiGUI;
class wiWindow;
class wiLabel;
class wiCheckBox;
class wiSlider;
struct Decal;
class DecalWindow
{
public:
@@ -17,9 +19,9 @@ public:
wiGUI* GUI;
void SetDecal(Decal* decal);
void SetDecal(wiSceneComponents::Decal* decal);
Decal* decal;
wiSceneComponents::Decal* decal;
wiWindow* decalWindow;
wiSlider* opacitySlider;
+1
View File
@@ -24,6 +24,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiRectPacker;
using namespace wiSceneComponents;
Editor::Editor()
{
+1
View File
@@ -5,6 +5,7 @@
#include <sstream>
using namespace std;
using namespace wiSceneComponents;
EmitterWindow::EmitterWindow(wiGUI* gui) : GUI(gui)
{
+7 -3
View File
@@ -1,6 +1,10 @@
#pragma once
struct Object;
namespace wiSceneComponents
{
struct Object;
}
class wiEmittedParticle;
class wiGUI;
@@ -19,11 +23,11 @@ public:
EmitterWindow(wiGUI* gui);
~EmitterWindow();
void SetObject(Object* obj);
void SetObject(wiSceneComponents::Object* obj);
void SetMaterialWnd(MaterialWindow* wnd);
void UpdateData();
Object* object;
wiSceneComponents::Object* object;
wiEmittedParticle* GetEmitter();
wiGUI* GUI;
+2
View File
@@ -1,6 +1,8 @@
#include "stdafx.h"
#include "EnvProbeWindow.h"
using namespace wiSceneComponents;
EnvProbeWindow::EnvProbeWindow(wiGUI* gui) : GUI(gui)
{
probe = nullptr;
+7 -3
View File
@@ -1,6 +1,10 @@
#pragma once
struct Material;
namespace wiSceneComponents
{
struct EnvironmentProbe;
}
class wiGUI;
class wiWindow;
class wiLabel;
@@ -15,8 +19,8 @@ public:
wiGUI* GUI;
EnvironmentProbe* probe;
void SetProbe(EnvironmentProbe* value);
wiSceneComponents::EnvironmentProbe* probe;
void SetProbe(wiSceneComponents::EnvironmentProbe* value);
wiWindow* envProbeWindow;
+2
View File
@@ -1,6 +1,8 @@
#include "stdafx.h"
#include "ForceFieldWindow.h"
using namespace wiSceneComponents;
ForceFieldWindow::ForceFieldWindow(wiGUI* gui) : GUI(gui)
{
+6 -3
View File
@@ -1,6 +1,9 @@
#pragma once
struct ForceField;
namespace wiSceneComponents
{
struct ForceField;
}
class wiGUI;
class wiWindow;
@@ -16,9 +19,9 @@ public:
ForceFieldWindow(wiGUI* gui);
~ForceFieldWindow();
void SetForceField(ForceField* force);
void SetForceField(wiSceneComponents::ForceField* force);
ForceField* force;
wiSceneComponents::ForceField* force;
wiGUI* GUI;
+2
View File
@@ -1,6 +1,8 @@
#include "stdafx.h"
#include "LightWindow.h"
using namespace wiSceneComponents;
LightWindow::LightWindow(wiGUI* gui) : GUI(gui), light(nullptr)
{
+9 -6
View File
@@ -1,6 +1,11 @@
#pragma once
struct Material;
namespace wiSceneComponents
{
struct Light;
}
class wiGUI;
class wiWindow;
class wiLabel;
@@ -10,8 +15,6 @@ class wiButton;
class wiColorPicker;
class wiComboBox;
struct Light;
class LightWindow
{
public:
@@ -20,10 +23,10 @@ public:
wiGUI* GUI;
void SetLight(Light* light);
void SetLightType(Light::LightType type);
void SetLight(wiSceneComponents::Light* light);
void SetLightType(wiSceneComponents::Light::LightType type);
Light* light;
wiSceneComponents::Light* light;
wiWindow* lightWindow;
wiSlider* energySlider;
+1
View File
@@ -6,6 +6,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
MaterialWindow::MaterialWindow(wiGUI* gui) : GUI(gui)
{
+7 -3
View File
@@ -1,6 +1,10 @@
#pragma once
struct Material;
namespace wiSceneComponents
{
struct Material;
}
class wiGUI;
class wiWindow;
class wiLabel;
@@ -17,11 +21,11 @@ public:
MaterialWindow(wiGUI* gui);
~MaterialWindow();
void SetMaterial(Material* mat);
void SetMaterial(wiSceneComponents::Material* mat);
wiGUI* GUI;
Material* material;
wiSceneComponents::Material* material;
wiWindow* materialWindow;
wiTextInputField* materialNameField;
+1
View File
@@ -4,6 +4,7 @@
#include <sstream>
using namespace std;
using namespace wiSceneComponents;
MeshWindow::MeshWindow(wiGUI* gui) : GUI(gui)
{
+7 -5
View File
@@ -1,6 +1,10 @@
#pragma once
struct Material;
namespace wiSceneComponents
{
struct Mesh;
}
class wiGUI;
class wiWindow;
class wiLabel;
@@ -8,8 +12,6 @@ class wiCheckBox;
class wiSlider;
class wiButton;
struct Mesh;
class MeshWindow
{
public:
@@ -18,9 +20,9 @@ public:
wiGUI* GUI;
void SetMesh(Mesh* mesh);
void SetMesh(wiSceneComponents::Mesh* mesh);
Mesh* mesh;
wiSceneComponents::Mesh* mesh;
wiWindow* meshWindow;
wiLabel* meshInfoLabel;
+7 -4
View File
@@ -1,9 +1,12 @@
#pragma once
#include <string>
struct Model;
namespace wiSceneComponents
{
struct Model;
}
Model* ImportModel_WIO(const std::string& fileName);
Model* ImportModel_OBJ(const std::string& fileName);
Model* ImportModel_GLTF(const std::string& fileName);
wiSceneComponents::Model* ImportModel_WIO(const std::string& fileName);
wiSceneComponents::Model* ImportModel_OBJ(const std::string& fileName);
wiSceneComponents::Model* ImportModel_GLTF(const std::string& fileName);
+2
View File
@@ -10,6 +10,8 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
namespace tinygltf
{
+1
View File
@@ -8,6 +8,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
Model* ImportModel_OBJ(const std::string& fileName)
{
+9 -8
View File
@@ -6,9 +6,10 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
Mesh* LoadMeshFromBinaryFile(const std::string& newName, const std::string& fname, const MaterialCollection& materialColl, const unordered_set<Armature*>& armatures)
Mesh* LoadMeshFromBinaryFile(const std::string& newName, const std::string& fname, const std::map<std::string, Material*>& materialColl, const unordered_set<Armature*>& armatures)
{
Mesh* mesh = new Mesh(newName);
@@ -83,7 +84,7 @@ Mesh* LoadMeshFromBinaryFile(const std::string& newName, const std::string& fnam
stringstream identified_matname("");
identified_matname << matName;
MaterialCollection::const_iterator iter = materialColl.find(identified_matname.str());
auto& iter = materialColl.find(identified_matname.str());
if (iter != materialColl.end()) {
mesh->subsets.push_back(MeshSubset());
mesh->subsets.back().material = iter->second;
@@ -393,7 +394,7 @@ void LoadWiArmatures(const std::string& directory, const std::string& name, unor
}
}
void LoadWiMaterialLibrary(const std::string& directory, const std::string& name, const std::string& texturesDir, MaterialCollection& materials)
void LoadWiMaterialLibrary(const std::string& directory, const std::string& name, const std::string& texturesDir, std::map<std::string, Material*>& materials)
{
int materialI = (int)(materials.size() - 1);
@@ -543,7 +544,7 @@ void LoadWiMaterialLibrary(const std::string& directory, const std::string& name
}
void LoadWiObjects(const std::string& directory, const std::string& name, unordered_set<Object*>& objects
, unordered_set<Armature*>& armatures
, MeshCollection& meshes, const MaterialCollection& materials)
, std::map<std::string, Mesh*>& meshes, const std::map<std::string, Material*>& materials)
{
stringstream filename("");
@@ -572,7 +573,7 @@ void LoadWiObjects(const std::string& directory, const std::string& name, unorde
string meshName = "";
file >> meshName;
object->meshName = meshName;
MeshCollection::iterator iter = meshes.find(meshName);
auto& iter = meshes.find(meshName);
if (line[1] == 'b')
{
@@ -678,8 +679,8 @@ void LoadWiObjects(const std::string& directory, const std::string& name, unorde
file.close();
}
void LoadWiMeshes(const std::string& directory, const std::string& name, MeshCollection& meshes,
const unordered_set<Armature*>& armatures, const MaterialCollection& materials)
void LoadWiMeshes(const std::string& directory, const std::string& name, std::map<std::string, Mesh*>& meshes,
const unordered_set<Armature*>& armatures, const std::map<std::string, Material*>& materials)
{
int meshI = (int)(meshes.size() - 1);
Mesh* currentMesh = NULL;
@@ -838,7 +839,7 @@ void LoadWiMeshes(const std::string& directory, const std::string& name, MeshCol
string mName = "";
file >> mName;
currentMesh->materialNames.push_back(mName);
MaterialCollection::const_iterator iter = materials.find(mName);
auto& iter = materials.find(mName);
if (iter != materials.end()) {
currentMesh->subsets.push_back(MeshSubset());
currentMesh->renderable = true;
+2
View File
@@ -1,6 +1,8 @@
#include "stdafx.h"
#include "ObjectWindow.h"
using namespace wiSceneComponents;
ObjectWindow::ObjectWindow(wiGUI* gui) : GUI(gui)
{
+6 -3
View File
@@ -1,6 +1,9 @@
#pragma once
struct Object;
namespace wiSceneComponents
{
struct Object;
}
class wiGUI;
class wiWindow;
@@ -16,9 +19,9 @@ public:
ObjectWindow(wiGUI* gui);
~ObjectWindow();
void SetObject(Object* obj);
void SetObject(wiSceneComponents::Object* obj);
Object* object;
wiSceneComponents::Object* object;
wiGUI* GUI;
-1
View File
@@ -1,6 +1,5 @@
#pragma once
struct Material;
class wiGUI;
class wiWindow;
class wiLabel;
+1
View File
@@ -7,6 +7,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
WorldWindow::WorldWindow(wiGUI* gui) : GUI(gui)
{
-1
View File
@@ -1,6 +1,5 @@
#pragma once
struct Material;
class wiGUI;
class wiWindow;
class wiLabel;
@@ -7,6 +7,7 @@
#include "wiSprite.h"
#include "ResourceMapping.h"
#include "wiProfiler.h"
#include "wiSceneComponents.h"
using namespace wiGraphicsTypes;
+1 -1
View File
@@ -4,7 +4,7 @@
#include "wiImageEffects.h"
#include "wiHelper.h"
#include "wiTextureHelper.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "ResourceMapping.h"
#include "wiProfiler.h"
+2 -4
View File
@@ -19,7 +19,7 @@
#include "wiFont.h"
#include "wiFrameRate.h"
#include "wiCpuInfo.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiEmittedParticle.h"
#include "wiHairParticle.h"
#include "wiRenderer.h"
@@ -69,9 +69,7 @@
#include "LoadingScreenComponent.h"
#include "MainComponent.h"
#include "wiGraphicsDevice_DX11.h"
#include "wiGraphicsDevice_DX12.h"
#include "wiGraphicsDevice_Vulkan.h"
#include "wiGraphicsDevice.h"
#ifdef _WIN32
+4 -4
View File
@@ -339,8 +339,8 @@
<ClInclude Include="$(MSBuildThisFileDirectory)wiInputManager_BindLua.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiLensFlare.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiLines.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiLoader.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiLoader_BindLua.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiSceneComponents.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiSceneComponents_BindLua.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiLua.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiLua_Globals.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)wiLuna.h" />
@@ -684,8 +684,8 @@
<ClCompile Include="$(MSBuildThisFileDirectory)wiIntersectables.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiLensFlare.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiLines.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiLoader.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiLoader_BindLua.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiSceneComponents.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiSceneComponents_BindLua.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiLua.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiMath.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)wiNetwork.cpp" />
@@ -222,9 +222,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)wiInputManager_BindLua.h">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)wiLoader_BindLua.h">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)wiNetwork_BindLua.h">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClInclude>
@@ -897,9 +894,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)wiEmittedParticle.h">
<Filter>ENGINE\Graphics</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)wiLoader.h">
<Filter>ENGINE\Graphics</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)wiRenderer.h">
<Filter>ENGINE\Graphics</Filter>
</ClInclude>
@@ -1152,6 +1146,12 @@
<ClInclude Include="$(MSBuildThisFileDirectory)Utility\stb_image_write.h">
<Filter>UTILITY</Filter>
</ClInclude>
<ClInclude Include="C:\PROJECTS\WickedEngine\WickedEngine\wiSceneComponents.h">
<Filter>ENGINE\Graphics</Filter>
</ClInclude>
<ClInclude Include="C:\PROJECTS\WickedEngine\WickedEngine\wiSceneComponents_BindLua.h">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)LUA\lapi.c">
@@ -1325,9 +1325,6 @@
<ClCompile Include="$(MSBuildThisFileDirectory)wiInputManager_BindLua.cpp">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)wiLoader_BindLua.cpp">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)wiNetwork_BindLua.cpp">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClCompile>
@@ -1781,9 +1778,6 @@
<ClCompile Include="$(MSBuildThisFileDirectory)wiEmittedParticle.cpp">
<Filter>ENGINE\Graphics</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)wiLoader.cpp">
<Filter>ENGINE\Graphics</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)wiRenderer.cpp">
<Filter>ENGINE\Graphics</Filter>
</ClCompile>
@@ -1952,6 +1946,12 @@
<ClCompile Include="$(MSBuildThisFileDirectory)Utility\utility_common.cpp">
<Filter>UTILITY</Filter>
</ClCompile>
<ClCompile Include="C:\PROJECTS\WickedEngine\WickedEngine\wiSceneComponents.cpp">
<Filter>ENGINE\Graphics</Filter>
</ClCompile>
<ClCompile Include="C:\PROJECTS\WickedEngine\WickedEngine\wiSceneComponents_BindLua.cpp">
<Filter>ENGINE\Scripting\LuaBindings</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="$(MSBuildThisFileDirectory)fonts\default_font.dds">
+2 -1
View File
@@ -1,5 +1,5 @@
#include "wiBULLET.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
@@ -12,6 +12,7 @@
#include "BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h"
using namespace std;
using namespace wiSceneComponents;
int PHYSICS::softBodyIterationCount=5;
bool PHYSICS::rigidBodyPhysicsEnabled = true, PHYSICS::softBodyPhysicsEnabled = true;
+5 -5
View File
@@ -50,19 +50,19 @@ public:
void addTriangleMesh(const std::vector<XMFLOAT4>& vertices, const std::vector<unsigned int>& indices, const XMFLOAT3& sca, const XMFLOAT4& rot, const XMFLOAT3& pos
, float newMass, float newFriction, float newRestitution, float newDamping, bool kinematic);
void addSoftBodyTriangleMesh(const Mesh* mesh, const XMFLOAT3& sca, const XMFLOAT4& rot, const XMFLOAT3& pos
void addSoftBodyTriangleMesh(const wiSceneComponents::Mesh* mesh, const XMFLOAT3& sca, const XMFLOAT4& rot, const XMFLOAT3& pos
, float newMass, float newFriction, float newRestitution, float newDamping);
void addBone(float rad, float hei);
void connectVerticesToSoftBody(Mesh* const mesh, int objectI);
void connectSoftBodyToVertices(const Mesh* const mesh, int objectI);
void connectVerticesToSoftBody(wiSceneComponents::Mesh* const mesh, int objectI);
void connectSoftBodyToVertices(const wiSceneComponents::Mesh* const mesh, int objectI);
void transformBody(const XMFLOAT4& rot, const XMFLOAT3& pos, int objectI);
PhysicsTransform* getObject(int index);
void registerObject(Object* object);
void removeObject(Object* object);
void registerObject(wiSceneComponents::Object* object);
void removeObject(wiSceneComponents::Object* object);
void Update(float dt);
void MarkForRead();
+2 -1
View File
@@ -1,6 +1,6 @@
#include "wiEmittedParticle.h"
#include "wiMath.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiRenderer.h"
#include "wiResourceManager.h"
#include "wiFrustum.h"
@@ -13,6 +13,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
VertexShader *wiEmittedParticle::vertexShader = nullptr;
PixelShader *wiEmittedParticle::pixelShader[PARTICLESHADERTYPE_COUNT] = {};
+9 -6
View File
@@ -5,11 +5,14 @@
#include "ShaderInterop_EmittedParticle.h"
#include "wiImageEffects.h"
struct Object;
struct Material;
class wiArchive;
namespace wiSceneComponents
{
struct Object;
struct Material;
}
class wiEmittedParticle
{
public:
@@ -63,7 +66,7 @@ private:
public:
wiEmittedParticle();
wiEmittedParticle(const std::string& newName, const std::string& newMat, Object* newObject, float newSize, float newRandomFac, float newNormalFac
wiEmittedParticle(const std::string& newName, const std::string& newMat, wiSceneComponents::Object* newObject, float newSize, float newRandomFac, float newNormalFac
,float newCount, float newLife, float newRandLife, float newScaleX, float newScaleY, float newRot);
wiEmittedParticle(const wiEmittedParticle& other);
static void SetUpStatic();
@@ -90,9 +93,9 @@ public:
PARTICLESHADERTYPE shaderType = SOFT;
std::string name;
Object* object;
wiSceneComponents::Object* object;
std::string materialName;
Material* material;
wiSceneComponents::Material* material;
float size,random_factor,normal_factor;
float count,life,random_life;
+1 -1
View File
@@ -2,7 +2,7 @@
#include "wiRenderer.h"
#include "wiResourceManager.h"
#include "wiHelper.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "ResourceMapping.h"
#include <fstream>
+2 -1
View File
@@ -1,7 +1,7 @@
#include "wiHairParticle.h"
#include "wiRenderer.h"
#include "wiResourceManager.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiMath.h"
#include "wiFrustum.h"
#include "wiRandom.h"
@@ -12,6 +12,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
VertexShader *wiHairParticle::vs = nullptr;
PixelShader *wiHairParticle::ps[];
+14 -11
View File
@@ -5,14 +5,17 @@
#include "wiSPTree.h"
struct SkinnedVertex;
struct Mesh;
struct Object;
struct Material;
struct Camera;
class wiArchive;
namespace wiSceneComponents
{
struct SkinnedVertex;
struct Mesh;
struct Object;
struct Material;
struct Camera;
}
class wiHairParticle
{
public:
@@ -54,14 +57,14 @@ public:
public:
wiHairParticle();
wiHairParticle(const std::string& newName, float newLen, int newCount
, const std::string& newMat, Object* newObject, const std::string& densityGroup, const std::string& lengthGroup);
, const std::string& newMat, wiSceneComponents::Object* newObject, const std::string& densityGroup, const std::string& lengthGroup);
wiHairParticle(const wiHairParticle& other);
void CleanUp();
void Generate();
void ComputeCulling(Camera* camera, GRAPHICSTHREAD threadID);
void Draw(Camera* camera, SHADERTYPE shaderType, bool transparent, GRAPHICSTHREAD threadID);
void ComputeCulling(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
void Draw(wiSceneComponents::Camera* camera, SHADERTYPE shaderType, bool transparent, GRAPHICSTHREAD threadID);
static void CleanUpStatic();
static void SetUpStatic();
@@ -70,9 +73,9 @@ public:
float length;
int count;
std::string name, densityG, lenG, materialName;
Material* material;
wiSceneComponents::Material* material;
XMFLOAT4X4 OriginalMatrix_Inverse;
Object* object;
wiSceneComponents::Object* object;
size_t particleCount;
void Serialize(wiArchive& archive);
+1 -1
View File
@@ -2,7 +2,7 @@
#include "wiResourceManager.h"
#include "wiRenderer.h"
#include "wiImageEffects.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiHelper.h"
#include "SamplerMapping.h"
#include "ResourceMapping.h"
-298
View File
@@ -1,298 +0,0 @@
#pragma once
#include "wiLua.h"
#include "wiLuna.h"
#include "wiLoader.h"
namespace wiLoader_BindLua
{
void Bind();
}
class Node_BindLua
{
public:
Node* node;
static const char className[];
static Luna<Node_BindLua>::FunctionType methods[];
static Luna<Node_BindLua>::PropertyType properties[];
Node_BindLua(Node* node = nullptr);
Node_BindLua(lua_State *L);
~Node_BindLua();
int GetName(lua_State* L);
int SetName(lua_State* L);
int SetLayerMask(lua_State *L);
int GetLayerMask(lua_State *L);
static void Bind();
};
class Transform_BindLua : public Node_BindLua
{
public:
Transform* transform;
static const char className[];
static Luna<Transform_BindLua>::FunctionType methods[];
static Luna<Transform_BindLua>::PropertyType properties[];
Transform_BindLua(Transform* transform = nullptr);
Transform_BindLua(lua_State *L);
~Transform_BindLua();
int AttachTo(lua_State* L);
int Detach(lua_State* L);
int DetachChild(lua_State* L);
int ApplyTransform(lua_State* L);
int Scale(lua_State* L);
int Rotate(lua_State* L);
int Translate(lua_State* L);
int Lerp(lua_State* L);
int CatmullRom(lua_State* L);
int MatrixTransform(lua_State* L);
int GetMatrix(lua_State* L);
int ClearTransform(lua_State* L);
int SetTransform(lua_State* L);
int GetPosition(lua_State* L);
int GetRotation(lua_State* L);
int GetScale(lua_State* L);
static void Bind();
};
class Cullable_BindLua
{
public:
Cullable* cullable;
static const char className[];
static Luna<Cullable_BindLua>::FunctionType methods[];
static Luna<Cullable_BindLua>::PropertyType properties[];
Cullable_BindLua(Cullable* cullable = nullptr);
Cullable_BindLua(lua_State *L);
~Cullable_BindLua();
int Intersects(lua_State *L);
int GetAABB(lua_State* L);
int SetAABB(lua_State* L);
static void Bind();
};
class Object_BindLua : public Cullable_BindLua, public Transform_BindLua
{
public:
Object* object;
static const char className[];
static Luna<Object_BindLua>::FunctionType methods[];
static Luna<Object_BindLua>::PropertyType properties[];
Object_BindLua(Object* object = nullptr);
Object_BindLua(lua_State *L);
~Object_BindLua();
int EmitTrail(lua_State *L);
int SetTrailDistortTex(lua_State *L);
int SetTrailTex(lua_State *L);
int SetTransparency(lua_State *L);
int GetTransparency(lua_State *L);
int SetColor(lua_State *L);
int GetColor(lua_State *L);
int GetEmitter(lua_State *L);
int IsValid(lua_State *L);
static void Bind();
};
class Armature_BindLua : public Transform_BindLua
{
public:
Armature* armature;
static const char className[];
static Luna<Armature_BindLua>::FunctionType methods[];
static Luna<Armature_BindLua>::PropertyType properties[];
Armature_BindLua(Armature* armature = nullptr);
Armature_BindLua(lua_State* L);
~Armature_BindLua();
int GetAction(lua_State* L);
int GetActions(lua_State* L);
int GetBones(lua_State* L);
int GetBone(lua_State* L);
int GetFrame(lua_State* L);
int GetFrameCount(lua_State* L);
int IsValid(lua_State *L);
int ChangeAction(lua_State* L);
int StopAction(lua_State* L);
int PauseAction(lua_State* L);
int PlayAction(lua_State* L);
int ResetAction(lua_State* L);
int AddAnimLayer(lua_State* L);
int DeleteAnimLayer(lua_State* L);
int SetAnimLayerWeight(lua_State* L);
int SetAnimLayerLooped(lua_State* L);
static void Bind();
};
class Decal_BindLua : public Cullable_BindLua, public Transform_BindLua
{
public:
Decal* decal;
static const char className[];
static Luna<Decal_BindLua>::FunctionType methods[];
static Luna<Decal_BindLua>::PropertyType properties[];
Decal_BindLua(Decal* decal);
Decal_BindLua(lua_State* L);
~Decal_BindLua();
int SetTexture(lua_State* L);
int SetNormal(lua_State* L);
int SetLife(lua_State* L);
int GetLife(lua_State* L);
int SetFadeStart(lua_State* L);
int GetFadeStart(lua_State* L);
static void Bind();
};
class Ray_BindLua
{
public:
RAY ray;
static const char className[];
static Luna<Ray_BindLua>::FunctionType methods[];
static Luna<Ray_BindLua>::PropertyType properties[];
Ray_BindLua(const RAY& ray);
Ray_BindLua(lua_State* L);
~Ray_BindLua();
int GetOrigin(lua_State* L);
int GetDirection(lua_State* L);
static void Bind();
};
class AABB_BindLua
{
public:
AABB aabb;
static const char className[];
static Luna<AABB_BindLua>::FunctionType methods[];
static Luna<AABB_BindLua>::PropertyType properties[];
AABB_BindLua(const AABB& ray);
AABB_BindLua(lua_State* L);
~AABB_BindLua();
int Intersects(lua_State* L);
int Transform(lua_State* L);
int GetMin(lua_State* L);
int GetMax(lua_State* L);
static void Bind();
};
class EmittedParticle_BindLua
{
public:
wiEmittedParticle* ps;
static const char className[];
static Luna<EmittedParticle_BindLua>::FunctionType methods[];
static Luna<EmittedParticle_BindLua>::PropertyType properties[];
EmittedParticle_BindLua(wiEmittedParticle* ps);
EmittedParticle_BindLua(lua_State* L);
~EmittedParticle_BindLua();
int GetName(lua_State* L);
int SetName(lua_State* L);
int GetMotionBlur(lua_State* L);
int SetMotionBlur(lua_State* L);
int Burst(lua_State* L);
int IsValid(lua_State* L);
static void Bind();
};
class Material_BindLua
{
public:
Material* material;
static const char className[];
static Luna<Material_BindLua>::FunctionType methods[];
static Luna<Material_BindLua>::PropertyType properties[];
Material_BindLua(Material* material);
Material_BindLua(lua_State* L);
~Material_BindLua();
int GetName(lua_State* L);
int SetName(lua_State* L);
int GetColor(lua_State* L);
int SetColor(lua_State* L);
int GetAlpha(lua_State* L);
int SetAlpha(lua_State* L);
int GetRefractionIndex(lua_State* L);
int SetRefractionIndex(lua_State* L);
static void Bind();
};
class Camera_BindLua : public Transform_BindLua
{
public:
Camera* cam;
static const char className[];
static Luna<Camera_BindLua>::FunctionType methods[];
static Luna<Camera_BindLua>::PropertyType properties[];
Camera_BindLua(Camera* cam);
Camera_BindLua(lua_State* L);
~Camera_BindLua();
int GetFarPlane(lua_State* L);
int SetFarPlane(lua_State* L);
int GetNearPlane(lua_State* L);
int SetNearPlane(lua_State* L);
int GetFOV(lua_State* L);
int SetFOV(lua_State* L);
int Lerp(lua_State* L);
int CatmullRom(lua_State* L);
static void Bind();
};
class Model_BindLua :public Transform_BindLua
{
public:
Model* model;
static const char className[];
static Luna<Model_BindLua>::FunctionType methods[];
static Luna<Model_BindLua>::PropertyType properties[];
Model_BindLua(Model* model);
Model_BindLua(lua_State* L);
~Model_BindLua();
static void Bind();
};
+2 -2
View File
@@ -17,7 +17,7 @@
#include "wiImageEffects_BindLua.h"
#include "SpriteAnim_BindLua.h"
#include "wiResourceManager_BindLua.h"
#include "wiLoader_BindLua.h"
#include "wiSceneComponents_BindLua.h"
#include "Vector_BindLua.h"
#include "Matrix_BindLua.h"
#include "wiInputManager_BindLua.h"
@@ -71,7 +71,7 @@ wiLua* wiLua::GetGlobal()
wiImageEffects_BindLua::Bind();
SpriteAnim_BindLua::Bind();
wiResourceManager_BindLua::Bind();
wiLoader_BindLua::Bind();
wiSceneComponents_BindLua::Bind();
Vector_BindLua::Bind();
Matrix_BindLua::Bind();
wiInputManager_BindLua::Bind();
+2 -1
View File
@@ -3,8 +3,9 @@
#include "wiResourceManager.h"
#include "ShaderInterop_Ocean.h"
using namespace wiGraphicsTypes;
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
ComputeShader* wiOcean::m_pUpdateSpectrumCS = nullptr;
ComputeShader* wiOcean::m_pUpdateDisplacementMapCS = nullptr;
+5 -3
View File
@@ -7,8 +7,10 @@
#include <vector>
struct Camera;
namespace wiSceneComponents
{
struct Camera;
}
struct wiOceanParameter
{
@@ -63,7 +65,7 @@ public:
~wiOcean();
void UpdateDisplacementMap(float time, GRAPHICSTHREAD threadID);
void Render(const Camera* camera, float time, GRAPHICSTHREAD threadID);
void Render(const wiSceneComponents::Camera* camera, float time, GRAPHICSTHREAD threadID);
wiGraphicsTypes::Texture2D* getDisplacementMap();
wiGraphicsTypes::Texture2D* getGradientMap();
+10 -7
View File
@@ -3,8 +3,11 @@
#include <vector>
struct Mesh;
struct Object;
namespace wiSceneComponents
{
struct Mesh;
struct Object;
}
class PHYSICS
{
@@ -54,17 +57,17 @@ public:
, float newMass=1, float newFriction=1, float newRestitution=1, float newDamping=1, bool kinematic=false)=0;
virtual void addSoftBodyTriangleMesh(const Mesh* mesh, const XMFLOAT3& sca, const XMFLOAT4& rot, const XMFLOAT3& pos
virtual void addSoftBodyTriangleMesh(const wiSceneComponents::Mesh* mesh, const XMFLOAT3& sca, const XMFLOAT4& rot, const XMFLOAT3& pos
, float newMass=1, float newFriction=1, float newRestitution=1, float newDamping=1)=0;
virtual void connectVerticesToSoftBody(Mesh* const mesh, int objectI)=0;
virtual void connectSoftBodyToVertices(const Mesh* const mesh, int objectI)=0;
virtual void connectVerticesToSoftBody(wiSceneComponents::Mesh* const mesh, int objectI)=0;
virtual void connectSoftBodyToVertices(const wiSceneComponents::Mesh* const mesh, int objectI)=0;
virtual void transformBody(const XMFLOAT4& rot, const XMFLOAT3& pos, int objectI)=0;
virtual PhysicsTransform* getObject(int index)=0;
// add object to the simulation
virtual void registerObject(Object* object) = 0;
virtual void registerObject(wiSceneComponents::Object* object) = 0;
// remove object from simulation
virtual void removeObject(Object* object) = 0;
virtual void removeObject(wiSceneComponents::Object* object) = 0;
};
+2
View File
@@ -3,6 +3,8 @@
#include "wiRenderer.h"
#include "wiFont.h"
#include <sstream>
using namespace std;
using namespace wiGraphicsTypes;
+6 -59
View File
@@ -4,7 +4,7 @@
#include "wiEmittedParticle.h"
#include "wiResourceManager.h"
#include "wiSprite.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiFrustum.h"
#include "wiRenderTarget.h"
#include "wiDepthTarget.h"
@@ -38,6 +38,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
#pragma region STATICS
GraphicsDevice* wiRenderer::graphicsDevice = nullptr;
@@ -2873,7 +2874,7 @@ Material* wiRenderer::getMaterialByName(const std::string& get)
{
for (Model* model : GetScene().models)
{
MaterialCollection::iterator iter = model->materials.find(get);
auto& iter = model->materials.find(get);
if (iter != model->materials.end())
return iter->second;
}
@@ -2924,60 +2925,6 @@ Light* wiRenderer::getLightByName(const std::string& name)
return nullptr;
}
Mesh::Vertex_FULL wiRenderer::TransformVertex(const Mesh* mesh, int vertexI, const XMMATRIX& mat)
{
XMMATRIX sump;
XMVECTOR pos = mesh->vertices_POS[vertexI].LoadPOS();
XMVECTOR nor = mesh->vertices_POS[vertexI].LoadNOR();
if (mesh->hasArmature() && !mesh->armature->boneCollection.empty())
{
XMFLOAT4 ind = mesh->vertices_BON[vertexI].GetInd_FULL();
XMFLOAT4 wei = mesh->vertices_BON[vertexI].GetWei_FULL();
float inWei[4] = {
wei.x,
wei.y,
wei.z,
wei.w
};
float inBon[4] = {
ind.x,
ind.y,
ind.z,
ind.w
};
if (inWei[0] || inWei[1] || inWei[2] || inWei[3])
{
sump = XMMATRIX(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
for (unsigned int i = 0; i < 4; i++)
{
sump += XMLoadFloat4x4(&mesh->armature->boneCollection[int(inBon[i])]->boneRelativity) * inWei[i];
}
}
else
{
sump = XMMatrixIdentity();
}
sump = XMMatrixMultiply(sump, mat);
}
else
{
sump = mat;
}
XMFLOAT3 transformedP, transformedN;
XMStoreFloat3(&transformedP, XMVector3Transform(pos, sump));
XMStoreFloat3(&transformedN, XMVector3Normalize(XMVector3TransformNormal(nor, sump)));
Mesh::Vertex_FULL retV(transformedP);
retV.nor = XMFLOAT4(transformedN.x, transformedN.y, transformedN.z, retV.nor.w);
retV.tex = mesh->vertices_FULL[vertexI].tex;
return retV;
}
void wiRenderer::FixedUpdate()
{
cam->UpdateTransform();
@@ -3461,7 +3408,7 @@ void wiRenderer::UpdateRenderData(GRAPHICSTHREAD threadID)
}
// Skinning:
for (MeshCollection::iterator iter = model->meshes.begin(); iter != model->meshes.end(); ++iter)
for (auto& iter = model->meshes.begin(); iter != model->meshes.end(); ++iter)
{
Mesh* mesh = iter->second;
@@ -8163,7 +8110,7 @@ void wiRenderer::RayIntersectMeshes(const RAY& ray, const CulledList& culledObje
{
for (size_t i = 0; i < mesh->vertices_POS.size(); ++i)
{
_tmpvert = TransformVertex(mesh, (int)i);
_tmpvert = mesh->TransformVertex((int)i);
_vertices[i] = XMLoadFloat4(&_tmpvert.pos);
}
}
@@ -8441,7 +8388,7 @@ void wiRenderer::SynchronizeWithPhysicsEngine(float dt)
for (std::map<int, float>::iterator it = mesh->vertexGroups[gvg].vertices.begin(); it != mesh->vertexGroups[gvg].vertices.end(); ++it)
{
int vi = (*it).first;
Mesh::Vertex_FULL tvert = TransformVertex(mesh, vi, worldMat);
Mesh::Vertex_FULL tvert = mesh->TransformVertex(vi, worldMat);
mesh->goalPositions[j] = XMFLOAT3(tvert.pos.x, tvert.pos.y, tvert.pos.z);
mesh->goalNormals[j] = XMFLOAT3(tvert.nor.x, tvert.nor.y, tvert.nor.z);
++j;
+87 -86
View File
@@ -3,30 +3,36 @@
#include "ShaderInterop.h"
#include "wiEnums.h"
#include "wiGraphicsAPI.h"
#include "wiSPTree.h"
#include "wiWindowRegistration.h"
#include "wiSPTree.h"
#include "wiFrustum.h"
#include <unordered_set>
#include <deque>
struct Transform;
struct Vertex;
struct SkinnedVertex;
struct Material;
struct Object;
struct Mesh;
struct Armature;
struct Bone;
struct KeyFrame;
struct SHCAM;
struct Light;
struct Decal;
struct WorldInfo;
struct Wind;
struct Camera;
struct RAY;
struct Camera;
struct Model;
struct Scene;
namespace wiSceneComponents
{
struct Transform;
struct Vertex;
struct SkinnedVertex;
struct Material;
struct Object;
struct Mesh;
struct Armature;
struct Bone;
struct KeyFrame;
struct SHCAM;
struct Light;
struct Decal;
struct WorldInfo;
struct Wind;
struct Camera;
struct Model;
struct Scene;
struct Cullable;
struct EnvironmentProbe;
struct ForceField;
}
class Lines;
class Cube;
@@ -37,16 +43,13 @@ class wiHairParticle;
class wiSprite;
class wiSPTree;
class TaskThread;
struct Cullable;
class PHYSICS;
class wiRenderTarget;
class wiWaterPlane;
class wiOcean;
struct wiOceanParameter;
typedef std::map<std::string, Mesh*> MeshCollection;
typedef std::map<std::string, Material*> MaterialCollection;
struct RAY;
class wiRenderer
{
@@ -275,7 +278,7 @@ protected:
static float GameSpeed, overrideGameSpeed;
static Scene* scene;
static wiSceneComponents::Scene* scene;
static wiWaterPlane waterPlane;
@@ -326,7 +329,7 @@ public:
static void OcclusionCulling_Read();
static void UpdateImages();
static void ManageImages();
static void PutDecal(Decal* decal);
static void PutDecal(wiSceneComponents::Decal* decal);
static void PutWaterRipple(const std::string& image, const XMFLOAT3& pos);
static void ManageWaterRipples();
static void DrawWaterRipples(GRAPHICSTHREAD threadID);
@@ -403,21 +406,19 @@ public:
static wiGraphicsTypes::Texture2D* GetLuminance(wiGraphicsTypes::Texture2D* sourceImage, GRAPHICSTHREAD threadID);
static wiWaterPlane GetWaterPlane();
static Transform* getTransformByName(const std::string& name);
static Transform* getTransformByID(uint64_t id);
static Armature* getArmatureByName(const std::string& get);
static int getActionByName(Armature* armature, const std::string& get);
static int getBoneByName(Armature* armature, const std::string& get);
static Material* getMaterialByName(const std::string& get);
static Object* getObjectByName(const std::string& name);
static Camera* getCameraByName(const std::string& name);
static Light* getLightByName(const std::string& name);
static wiSceneComponents::Transform* getTransformByName(const std::string& name);
static wiSceneComponents::Transform* getTransformByID(uint64_t id);
static wiSceneComponents::Armature* getArmatureByName(const std::string& get);
static int getActionByName(wiSceneComponents::Armature* armature, const std::string& get);
static int getBoneByName(wiSceneComponents::Armature* armature, const std::string& get);
static wiSceneComponents::Material* getMaterialByName(const std::string& get);
static wiSceneComponents::Object* getObjectByName(const std::string& name);
static wiSceneComponents::Camera* getCameraByName(const std::string& name);
static wiSceneComponents::Light* getLightByName(const std::string& name);
static void ReloadShaders(const std::string& path = "");
static void BindPersistentState(GRAPHICSTHREAD threadID);
static Mesh::Vertex_FULL TransformVertex(const Mesh* mesh, int vertexI, const XMMATRIX& mat = XMMatrixIdentity());
struct FrameCulling
{
Frustum frustum;
@@ -426,8 +427,8 @@ public:
CulledCollection culledRenderer_transparent;
std::vector<wiHairParticle*> culledHairParticleSystems;
CulledList culledLights;
std::list<Decal*> culledDecals;
std::list<EnvironmentProbe*> culledEnvProbes;
std::list<wiSceneComponents::Decal*> culledDecals;
std::list<wiSceneComponents::EnvironmentProbe*> culledEnvProbes;
void Clear()
{
@@ -440,7 +441,7 @@ public:
culledEnvProbes.clear();
}
};
static std::unordered_map<Camera*, FrameCulling> frameCullings;
static std::unordered_map<wiSceneComponents::Camera*, FrameCulling> frameCullings;
inline static XMUINT3 GetEntityCullingTileCount()
{
@@ -455,7 +456,7 @@ public:
static void UpdateWorldCB(GRAPHICSTHREAD threadID);
static void UpdateFrameCB(GRAPHICSTHREAD threadID);
static void UpdateCameraCB(Camera* camera, GRAPHICSTHREAD threadID);
static void UpdateCameraCB(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void SetClipPlane(const XMFLOAT4& clipPlane, GRAPHICSTHREAD threadID);
static void SetAlphaRef(float alphaRef, GRAPHICSTHREAD threadID);
static void ResetAlphaRef(GRAPHICSTHREAD threadID) { SetAlphaRef(0.75f, threadID); }
@@ -466,31 +467,31 @@ public:
bool tessellation = false, bool occlusionCulling = false, uint32_t layerMask = 0xFFFFFFFF);
static void DrawSky(GRAPHICSTHREAD threadID);
static void DrawSun(GRAPHICSTHREAD threadID);
static void DrawWorld(Camera* camera, bool tessellation, GRAPHICSTHREAD threadID, SHADERTYPE shaderType, bool grass, bool occlusionCulling, uint32_t layerMask = 0xFFFFFFFF);
static void DrawWorld(wiSceneComponents::Camera* camera, bool tessellation, GRAPHICSTHREAD threadID, SHADERTYPE shaderType, bool grass, bool occlusionCulling, uint32_t layerMask = 0xFFFFFFFF);
static void DrawForShadowMap(GRAPHICSTHREAD threadID, uint32_t layerMask = 0xFFFFFFFF);
static void DrawWorldTransparent(Camera* camera, SHADERTYPE shaderType, GRAPHICSTHREAD threadID, bool grass, bool occlusionCulling, uint32_t layerMask = 0xFFFFFFFF);
void DrawDebugSpheres(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugBoneLines(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugLines(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugBoxes(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawTranslators(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugEnvProbes(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugGridHelper(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugVoxels(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugEmitters(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugForceFields(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugCameras(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawSoftParticles(Camera* camera, bool distortion, GRAPHICSTHREAD threadID);
static void DrawWorldTransparent(wiSceneComponents::Camera* camera, SHADERTYPE shaderType, GRAPHICSTHREAD threadID, bool grass, bool occlusionCulling, uint32_t layerMask = 0xFFFFFFFF);
void DrawDebugSpheres(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugBoneLines(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugLines(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugBoxes(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawTranslators(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugEnvProbes(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugGridHelper(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugVoxels(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugEmitters(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugForceFields(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDebugCameras(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawSoftParticles(wiSceneComponents::Camera* camera, bool distortion, GRAPHICSTHREAD threadID);
static void DrawTrails(GRAPHICSTHREAD threadID, wiGraphicsTypes::Texture2D* refracRes);
static void DrawImagesAdd(GRAPHICSTHREAD threadID, wiGraphicsTypes::Texture2D* refracRes);
//alpha-opaque
static void DrawImages(GRAPHICSTHREAD threadID, wiGraphicsTypes::Texture2D* refracRes);
static void DrawImagesNormals(GRAPHICSTHREAD threadID, wiGraphicsTypes::Texture2D* refracRes);
static void DrawLights(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawLightVisualizers(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawVolumeLights(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawLights(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawLightVisualizers(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawVolumeLights(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void DrawLensFlares(GRAPHICSTHREAD threadID);
static void DrawDecals(Camera* camera, GRAPHICSTHREAD threadID);
static void DrawDecals(wiSceneComponents::Camera* camera, GRAPHICSTHREAD threadID);
static void RefreshEnvProbes(GRAPHICSTHREAD threadID);
static void VoxelRadiance(GRAPHICSTHREAD threadID);
@@ -498,7 +499,7 @@ public:
static void ResolveMSAADepthBuffer(wiGraphicsTypes::Texture2D* dst, wiGraphicsTypes::Texture2D* src, GRAPHICSTHREAD threadID);
static void BuildSceneBVH(GRAPHICSTHREAD threadID);
static void DrawTracedScene(Camera* camera, wiGraphicsTypes::Texture2D* result, GRAPHICSTHREAD threadID);
static void DrawTracedScene(wiSceneComponents::Camera* camera, wiGraphicsTypes::Texture2D* result, GRAPHICSTHREAD threadID);
enum MIPGENFILTER
{
@@ -541,13 +542,13 @@ public:
static wiSPTree* spTree_lights;
// The scene holds all models, world information and wind information
static Scene& GetScene();
static wiSceneComponents::Scene& GetScene();
static std::vector<Lines*> boneLines;
static std::vector<Lines*> linesTemp;
static std::vector<Cube> cubes;
static std::unordered_set<Object*> objectsWithTrails;
static std::unordered_set<wiSceneComponents::Object*> objectsWithTrails;
static std::unordered_set<wiEmittedParticle*> emitterSystems;
static std::deque<wiSprite*> images;
@@ -557,21 +558,21 @@ public:
static wiRenderTarget normalMapRT, imagesRT, imagesRTAdd;
static Camera* cam, *refCam, *prevFrameCam;
static Camera* getCamera(){ return cam; }
static Camera* getRefCamera(){ return refCam; }
static wiSceneComponents::Camera* cam, *refCam, *prevFrameCam;
static wiSceneComponents::Camera* getCamera(){ return cam; }
static wiSceneComponents::Camera* getRefCamera(){ return refCam; }
std::string DIRECTORY;
struct Picked
{
Transform* transform;
Object* object;
Light* light;
Decal* decal;
EnvironmentProbe* envProbe;
ForceField* forceField;
Camera* camera;
wiSceneComponents::Transform* transform;
wiSceneComponents::Object* object;
wiSceneComponents::Light* light;
wiSceneComponents::Decal* decal;
wiSceneComponents::EnvironmentProbe* envProbe;
wiSceneComponents::ForceField* forceField;
wiSceneComponents::Camera* camera;
XMFLOAT3 position,normal;
float distance;
int subsetIndex;
@@ -617,7 +618,7 @@ public:
static RAY getPickRay(long cursorX, long cursorY);
static void RayIntersectMeshes(const RAY& ray, const CulledList& culledObjects, std::vector<Picked>& points,
int pickType = PICK_OPAQUE, bool dynamicObjects = true, bool onlyVisible = false, uint32_t layerMask = 0xFFFFFFFF);
static void CalculateVertexAO(Object* object);
static void CalculateVertexAO(wiSceneComponents::Object* object);
static PHYSICS* physicsEngine;
static void SynchronizeWithPhysicsEngine(float dt = 1.0f / 60.0f);
@@ -626,13 +627,13 @@ public:
static void SetOceanEnabled(bool enabled, const wiOceanParameter& params);
static wiOcean* GetOcean() { return ocean; }
static Model* LoadModel(const std::string& fileName, const XMMATRIX& transform = XMMatrixIdentity());
static wiSceneComponents::Model* LoadModel(const std::string& fileName, const XMMATRIX& transform = XMMatrixIdentity());
static void LoadWorldInfo(const std::string& fileName);
static void LoadDefaultLighting();
static void PutEnvProbe(const XMFLOAT3& position);
static void CreateImpostor(Mesh* mesh, GRAPHICSTHREAD threadID);
static void CreateImpostor(wiSceneComponents::Mesh* mesh, GRAPHICSTHREAD threadID);
static std::vector<wiTranslator*> renderableTranslators;
// Add translator to render in next frame
@@ -645,22 +646,22 @@ public:
static void AddDeferredMIPGen(wiGraphicsTypes::Texture2D* tex);
// Add model to the scene
static void AddModel(Model* value);
static void AddModel(wiSceneComponents::Model* value);
// Add Object Instance
static void Add(Object* value);
static void Add(wiSceneComponents::Object* value);
// Add Light Instance
static void Add(Light* value);
static void Add(wiSceneComponents::Light* value);
// Add Force Field Instance
static void Add(ForceField* value);
static void Add(wiSceneComponents::ForceField* value);
// Add Camera Instance
static void Add(Camera* value);
static void Add(wiSceneComponents::Camera* value);
// Remove from the scene
static void Remove(Object* value);
static void Remove(Light* value);
static void Remove(Decal* value);
static void Remove(EnvironmentProbe* value);
static void Remove(ForceField* value);
static void Remove(Camera* value);
static void Remove(wiSceneComponents::Object* value);
static void Remove(wiSceneComponents::Light* value);
static void Remove(wiSceneComponents::Decal* value);
static void Remove(wiSceneComponents::EnvironmentProbe* value);
static void Remove(wiSceneComponents::ForceField* value);
static void Remove(wiSceneComponents::Camera* value);
};
+3 -2
View File
@@ -1,9 +1,9 @@
#include "wiRenderer_BindLua.h"
#include "wiRenderer.h"
#include "wiLines.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiHelper.h"
#include "wiLoader_BindLua.h"
#include "wiSceneComponents_BindLua.h"
#include "Vector_BindLua.h"
#include "Matrix_BindLua.h"
#include "wiWaterPlane.h"
@@ -14,6 +14,7 @@
using namespace std;
using namespace wiGraphicsTypes;
using namespace wiSceneComponents_BindLua;
namespace wiRenderer_BindLua
{
@@ -4,6 +4,8 @@
#include "Texture_BindLua.h"
#include "wiRenderer.h"
#include <sstream>
using namespace std;
using namespace wiGraphicsTypes;
+3 -1
View File
@@ -1,8 +1,10 @@
#include "wiSPTree.h"
#include "wiMath.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiFrustum.h"
using namespace wiSceneComponents;
#define SP_TREE_MAX_DEPTH 12
#define SP_TREE_OBJECT_PER_NODE 6
#define SP_TREE_BOX_CONTAIN
+16 -9
View File
@@ -1,16 +1,23 @@
#pragma once
#include "CommonInclude.h"
#include "wiLoader.h"
#include "wiIntersectables.h"
#include <unordered_map>
#include <list>
namespace wiSceneComponents
{
struct Mesh;
struct Object;
struct Cullable;
}
class Frustum;
typedef std::list<Cullable*> CulledList;
typedef std::list<wiSceneComponents::Cullable*> CulledList;
typedef std::list<Object*> CulledObjectList;
typedef std::unordered_map<Mesh*,CulledObjectList> CulledCollection;
typedef std::list<wiSceneComponents::Object*> CulledObjectList;
typedef std::unordered_map<wiSceneComponents::Mesh*,CulledObjectList> CulledCollection;
class wiSPTree
{
@@ -19,7 +26,7 @@ protected:
wiSPTree();
public:
~wiSPTree();
void initialize(const std::vector<Cullable*>& objects, const XMFLOAT3& newMin = XMFLOAT3(FLOAT32_MAX, FLOAT32_MAX, FLOAT32_MAX), const XMFLOAT3& newMax = XMFLOAT3(-FLOAT32_MAX, -FLOAT32_MAX, -FLOAT32_MAX));
void initialize(const std::vector<wiSceneComponents::Cullable*>& objects, const XMFLOAT3& newMin = XMFLOAT3(FLT_MAX, FLT_MAX, FLT_MAX), const XMFLOAT3& newMax = XMFLOAT3(-FLT_MAX, -FLT_MAX, -FLT_MAX));
struct Node
{
@@ -63,7 +70,7 @@ public:
// Sort culled list by their distance to the origin point
static void Sort(const XMFLOAT3& origin, CulledList& objects, SortType sortType = SP_TREE_SORT_UNIQUE);
void AddObjects(Node* node, const std::vector<Cullable*>& newObjects);
void AddObjects(Node* node, const std::vector<wiSceneComponents::Cullable*>& newObjects);
void getVisible(Frustum& frustum, CulledList& objects, SortType sortType = SP_TREE_SORT_UNIQUE, CullStrictness type = SP_TREE_STRICT_CULL, Node* node = nullptr);
void getVisible(AABB& frustum, CulledList& objects, SortType sortType = SP_TREE_SORT_UNIQUE, CullStrictness type = SP_TREE_STRICT_CULL, Node* node = nullptr);
void getVisible(SPHERE& frustum, CulledList& objects, SortType sortType = SP_TREE_SORT_UNIQUE, CullStrictness type = SP_TREE_STRICT_CULL, Node* node = nullptr);
@@ -71,13 +78,13 @@ public:
void getAll(CulledList& objects, Node* node = nullptr);
// Updates the tree. Returns null if successful, returns a new tree if the tree is resized. The old tree can be thrown away then.
wiSPTree* updateTree(Node* node = nullptr);
void Remove(Cullable* value, Node* node = nullptr);
void Remove(wiSceneComponents::Cullable* value, Node* node = nullptr);
};
class Octree : public wiSPTree
{
public:
Octree(const std::vector<Cullable*>& objects, const XMFLOAT3& newMin = XMFLOAT3(FLOAT32_MAX, FLOAT32_MAX, FLOAT32_MAX), const XMFLOAT3& newMax = XMFLOAT3(-FLOAT32_MAX, -FLOAT32_MAX, -FLOAT32_MAX))
Octree(const std::vector<wiSceneComponents::Cullable*>& objects, const XMFLOAT3& newMin = XMFLOAT3(FLT_MAX, FLT_MAX, FLT_MAX), const XMFLOAT3& newMax = XMFLOAT3(-FLT_MAX, -FLT_MAX, -FLT_MAX))
{
childCount=8;
initialize(objects, newMin, newMax);
@@ -86,7 +93,7 @@ public:
class QuadTree : public wiSPTree
{
public:
QuadTree(const std::vector<Cullable*>& objects, const XMFLOAT3& newMin = XMFLOAT3(FLOAT32_MAX, FLOAT32_MAX, FLOAT32_MAX), const XMFLOAT3& newMax = XMFLOAT3(-FLOAT32_MAX, -FLOAT32_MAX, -FLOAT32_MAX))
QuadTree(const std::vector<wiSceneComponents::Cullable*>& objects, const XMFLOAT3& newMin = XMFLOAT3(FLT_MAX, FLT_MAX, FLT_MAX), const XMFLOAT3& newMax = XMFLOAT3(-FLT_MAX, -FLT_MAX, -FLT_MAX))
{
childCount = 4;
initialize(objects, newMin, newMax);
@@ -1,4 +1,4 @@
#include "wiLoader.h"
#include "wiSceneComponents.h"
#include "wiResourceManager.h"
#include "wiHelper.h"
#include "wiMath.h"
@@ -12,10 +12,14 @@
#include "wiArchive.h"
#include "wiBackLog.h"
#include <sstream>
using namespace std;
using namespace wiGraphicsTypes;
namespace wiSceneComponents
{
#pragma region SCENE
Model* _CreateWorldNode()
{
@@ -1069,6 +1073,60 @@ void Mesh::FlipNormals()
renderDataComplete = false;
CreateRenderData();
}
Mesh::Vertex_FULL Mesh::TransformVertex(int vertexI, const XMMATRIX& mat)
{
XMMATRIX sump;
XMVECTOR pos = vertices_POS[vertexI].LoadPOS();
XMVECTOR nor = vertices_POS[vertexI].LoadNOR();
if (hasArmature() && !armature->boneCollection.empty())
{
XMFLOAT4 ind = vertices_BON[vertexI].GetInd_FULL();
XMFLOAT4 wei = vertices_BON[vertexI].GetWei_FULL();
float inWei[4] = {
wei.x,
wei.y,
wei.z,
wei.w
};
float inBon[4] = {
ind.x,
ind.y,
ind.z,
ind.w
};
if (inWei[0] || inWei[1] || inWei[2] || inWei[3])
{
sump = XMMATRIX(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
for (unsigned int i = 0; i < 4; i++)
{
sump += XMLoadFloat4x4(&armature->boneCollection[int(inBon[i])]->boneRelativity) * inWei[i];
}
}
else
{
sump = XMMatrixIdentity();
}
sump = XMMatrixMultiply(sump, mat);
}
else
{
sump = mat;
}
XMFLOAT3 transformedP, transformedN;
XMStoreFloat3(&transformedP, XMVector3Transform(pos, sump));
XMStoreFloat3(&transformedN, XMVector3Normalize(XMVector3TransformNormal(nor, sump)));
Mesh::Vertex_FULL retV(transformedP);
retV.nor = XMFLOAT4(transformedN.x, transformedN.y, transformedN.z, retV.nor.w);
retV.tex = vertices_FULL[vertexI].tex;
return retV;
}
int Mesh::GetRenderTypes() const
{
@@ -1675,7 +1733,7 @@ void Model::Serialize(wiArchive& archive)
if (x->mesh == nullptr)
{
// find mesh
MeshCollection::iterator found = meshes.find(x->meshName);
auto& found = meshes.find(x->meshName);
if (found != meshes.end())
{
x->mesh = found->second;
@@ -1689,7 +1747,7 @@ void Model::Serialize(wiArchive& archive)
{
if (y.material == nullptr)
{
MaterialCollection::iterator it = materials.find(x->mesh->materialNames[i]);
auto& it = materials.find(x->mesh->materialNames[i]);
if (it != materials.end())
{
y.material = it->second;
@@ -1714,7 +1772,7 @@ void Model::Serialize(wiArchive& archive)
for (auto& y : x->eParticleSystems)
{
y->object = x;
MaterialCollection::iterator it = materials.find(y->materialName);
auto& it = materials.find(y->materialName);
if (it != materials.end())
{
y->material = it->second;
@@ -1723,7 +1781,7 @@ void Model::Serialize(wiArchive& archive)
for (auto& y : x->hParticleSystems)
{
y->object = x;
MaterialCollection::iterator it = materials.find(y->materialName);
auto& it = materials.find(y->materialName);
if (it != materials.end())
{
y->material = it->second;
@@ -2704,8 +2762,8 @@ void Object::EmitTrail(const XMFLOAT3& col, float fadeSpeed) {
if (base >= 0 && tip >= 0) {
XMFLOAT4 baseP, tipP;
XMFLOAT4 newCol = XMFLOAT4(col.x, col.y, col.z, 1);
baseP = wiRenderer::TransformVertex(mesh, base).pos;
tipP = wiRenderer::TransformVertex(mesh, tip).pos;
baseP = mesh->TransformVertex(base).pos;
tipP = mesh->TransformVertex(tip).pos;
trail.push_back(RibbonVertex(XMFLOAT3(baseP.x, baseP.y, baseP.z), XMFLOAT2(0,0), XMFLOAT4(0, 0, 0, 1),fadeSpeed));
trail.push_back(RibbonVertex(XMFLOAT3(tipP.x, tipP.y, tipP.z), XMFLOAT2(0,0), newCol,fadeSpeed));
@@ -3264,4 +3322,4 @@ void EnvironmentProbe::Serialize(wiArchive& archive)
#pragma endregion
}
@@ -17,11 +17,18 @@
#include <deque>
#include <sstream>
class wiArchive;
class wiParticle;
class wiEmittedParticle;
class wiHairParticle;
class wiRenderTarget;
namespace wiSceneComponents
{
struct Armature;
struct Bone;
struct Mesh;
@@ -29,11 +36,6 @@ struct Material;
struct Object;
struct Model;
typedef std::map<std::string,Mesh*> MeshCollection;
typedef std::map<std::string,Material*> MaterialCollection;
class wiArchive;
struct ModelChild
{
Model* parentModel = nullptr;
@@ -518,6 +520,7 @@ public:
void ComputeNormals(bool smooth = false);
void FlipCulling();
void FlipNormals();
Vertex_FULL TransformVertex(int vertexI, const XMMATRIX& mat = XMMatrixIdentity());
void init();
bool hasArmature() const { return armature != nullptr; }
@@ -1183,8 +1186,8 @@ struct ForceField : public Transform, public ModelChild
struct Model : public Transform
{
std::unordered_set<Object*> objects;
MeshCollection meshes;
MaterialCollection materials;
std::map<std::string, Mesh*> meshes;
std::map<std::string, Material*> materials;
std::unordered_set<Armature*> armatures;
std::unordered_set<Light*> lights;
std::unordered_set<Decal*> decals;
@@ -1225,6 +1228,5 @@ struct Scene
void Update();
};
// Load world info from file:
void LoadWiWorldInfo(const std::string& fileName, WorldInfo& worldInfo, Wind& wind);
}
@@ -1,4 +1,4 @@
#include "wiLoader_BindLua.h"
#include "wiSceneComponents_BindLua.h"
#include "Vector_BindLua.h"
#include "Matrix_BindLua.h"
#include "wiEmittedParticle.h"
@@ -6,29 +6,25 @@
using namespace std;
namespace wiLoader_BindLua
namespace wiSceneComponents_BindLua
{
void Bind()
{
Node_BindLua::Bind();
Transform_BindLua::Bind();
Cullable_BindLua::Bind();
Object_BindLua::Bind();
Armature_BindLua::Bind();
Ray_BindLua::Bind();
AABB_BindLua::Bind();
EmittedParticle_BindLua::Bind();
Decal_BindLua::Bind();
Material_BindLua::Bind();
Camera_BindLua::Bind();
Model_BindLua::Bind();
}
void Bind()
{
Node_BindLua::Bind();
Transform_BindLua::Bind();
Cullable_BindLua::Bind();
Object_BindLua::Bind();
Armature_BindLua::Bind();
Ray_BindLua::Bind();
AABB_BindLua::Bind();
EmittedParticle_BindLua::Bind();
Decal_BindLua::Bind();
Material_BindLua::Bind();
Camera_BindLua::Bind();
Model_BindLua::Bind();
}
const char Node_BindLua::className[] = "Node";
Luna<Node_BindLua>::FunctionType Node_BindLua::methods[] = {
@@ -2048,4 +2044,6 @@ void Model_BindLua::Bind()
initialized = true;
Luna<Model_BindLua>::Register(wiLua::GetGlobal()->GetLuaState());
}
}
}
}
+299
View File
@@ -0,0 +1,299 @@
#pragma once
#include "wiLua.h"
#include "wiLuna.h"
#include "wiSceneComponents.h"
using namespace wiSceneComponents;
namespace wiSceneComponents_BindLua
{
void Bind();
class Node_BindLua
{
public:
Node * node;
static const char className[];
static Luna<Node_BindLua>::FunctionType methods[];
static Luna<Node_BindLua>::PropertyType properties[];
Node_BindLua(Node* node = nullptr);
Node_BindLua(lua_State *L);
~Node_BindLua();
int GetName(lua_State* L);
int SetName(lua_State* L);
int SetLayerMask(lua_State *L);
int GetLayerMask(lua_State *L);
static void Bind();
};
class Transform_BindLua : public Node_BindLua
{
public:
Transform * transform;
static const char className[];
static Luna<Transform_BindLua>::FunctionType methods[];
static Luna<Transform_BindLua>::PropertyType properties[];
Transform_BindLua(Transform* transform = nullptr);
Transform_BindLua(lua_State *L);
~Transform_BindLua();
int AttachTo(lua_State* L);
int Detach(lua_State* L);
int DetachChild(lua_State* L);
int ApplyTransform(lua_State* L);
int Scale(lua_State* L);
int Rotate(lua_State* L);
int Translate(lua_State* L);
int Lerp(lua_State* L);
int CatmullRom(lua_State* L);
int MatrixTransform(lua_State* L);
int GetMatrix(lua_State* L);
int ClearTransform(lua_State* L);
int SetTransform(lua_State* L);
int GetPosition(lua_State* L);
int GetRotation(lua_State* L);
int GetScale(lua_State* L);
static void Bind();
};
class Cullable_BindLua
{
public:
Cullable * cullable;
static const char className[];
static Luna<Cullable_BindLua>::FunctionType methods[];
static Luna<Cullable_BindLua>::PropertyType properties[];
Cullable_BindLua(Cullable* cullable = nullptr);
Cullable_BindLua(lua_State *L);
~Cullable_BindLua();
int Intersects(lua_State *L);
int GetAABB(lua_State* L);
int SetAABB(lua_State* L);
static void Bind();
};
class Object_BindLua : public Cullable_BindLua, public Transform_BindLua
{
public:
Object * object;
static const char className[];
static Luna<Object_BindLua>::FunctionType methods[];
static Luna<Object_BindLua>::PropertyType properties[];
Object_BindLua(Object* object = nullptr);
Object_BindLua(lua_State *L);
~Object_BindLua();
int EmitTrail(lua_State *L);
int SetTrailDistortTex(lua_State *L);
int SetTrailTex(lua_State *L);
int SetTransparency(lua_State *L);
int GetTransparency(lua_State *L);
int SetColor(lua_State *L);
int GetColor(lua_State *L);
int GetEmitter(lua_State *L);
int IsValid(lua_State *L);
static void Bind();
};
class Armature_BindLua : public Transform_BindLua
{
public:
Armature * armature;
static const char className[];
static Luna<Armature_BindLua>::FunctionType methods[];
static Luna<Armature_BindLua>::PropertyType properties[];
Armature_BindLua(Armature* armature = nullptr);
Armature_BindLua(lua_State* L);
~Armature_BindLua();
int GetAction(lua_State* L);
int GetActions(lua_State* L);
int GetBones(lua_State* L);
int GetBone(lua_State* L);
int GetFrame(lua_State* L);
int GetFrameCount(lua_State* L);
int IsValid(lua_State *L);
int ChangeAction(lua_State* L);
int StopAction(lua_State* L);
int PauseAction(lua_State* L);
int PlayAction(lua_State* L);
int ResetAction(lua_State* L);
int AddAnimLayer(lua_State* L);
int DeleteAnimLayer(lua_State* L);
int SetAnimLayerWeight(lua_State* L);
int SetAnimLayerLooped(lua_State* L);
static void Bind();
};
class Decal_BindLua : public Cullable_BindLua, public Transform_BindLua
{
public:
Decal * decal;
static const char className[];
static Luna<Decal_BindLua>::FunctionType methods[];
static Luna<Decal_BindLua>::PropertyType properties[];
Decal_BindLua(Decal* decal);
Decal_BindLua(lua_State* L);
~Decal_BindLua();
int SetTexture(lua_State* L);
int SetNormal(lua_State* L);
int SetLife(lua_State* L);
int GetLife(lua_State* L);
int SetFadeStart(lua_State* L);
int GetFadeStart(lua_State* L);
static void Bind();
};
class Ray_BindLua
{
public:
RAY ray;
static const char className[];
static Luna<Ray_BindLua>::FunctionType methods[];
static Luna<Ray_BindLua>::PropertyType properties[];
Ray_BindLua(const RAY& ray);
Ray_BindLua(lua_State* L);
~Ray_BindLua();
int GetOrigin(lua_State* L);
int GetDirection(lua_State* L);
static void Bind();
};
class AABB_BindLua
{
public:
AABB aabb;
static const char className[];
static Luna<AABB_BindLua>::FunctionType methods[];
static Luna<AABB_BindLua>::PropertyType properties[];
AABB_BindLua(const AABB& ray);
AABB_BindLua(lua_State* L);
~AABB_BindLua();
int Intersects(lua_State* L);
int Transform(lua_State* L);
int GetMin(lua_State* L);
int GetMax(lua_State* L);
static void Bind();
};
class EmittedParticle_BindLua
{
public:
wiEmittedParticle * ps;
static const char className[];
static Luna<EmittedParticle_BindLua>::FunctionType methods[];
static Luna<EmittedParticle_BindLua>::PropertyType properties[];
EmittedParticle_BindLua(wiEmittedParticle* ps);
EmittedParticle_BindLua(lua_State* L);
~EmittedParticle_BindLua();
int GetName(lua_State* L);
int SetName(lua_State* L);
int GetMotionBlur(lua_State* L);
int SetMotionBlur(lua_State* L);
int Burst(lua_State* L);
int IsValid(lua_State* L);
static void Bind();
};
class Material_BindLua
{
public:
Material * material;
static const char className[];
static Luna<Material_BindLua>::FunctionType methods[];
static Luna<Material_BindLua>::PropertyType properties[];
Material_BindLua(Material* material);
Material_BindLua(lua_State* L);
~Material_BindLua();
int GetName(lua_State* L);
int SetName(lua_State* L);
int GetColor(lua_State* L);
int SetColor(lua_State* L);
int GetAlpha(lua_State* L);
int SetAlpha(lua_State* L);
int GetRefractionIndex(lua_State* L);
int SetRefractionIndex(lua_State* L);
static void Bind();
};
class Camera_BindLua : public Transform_BindLua
{
public:
Camera * cam;
static const char className[];
static Luna<Camera_BindLua>::FunctionType methods[];
static Luna<Camera_BindLua>::PropertyType properties[];
Camera_BindLua(Camera* cam);
Camera_BindLua(lua_State* L);
~Camera_BindLua();
int GetFarPlane(lua_State* L);
int SetFarPlane(lua_State* L);
int GetNearPlane(lua_State* L);
int SetNearPlane(lua_State* L);
int GetFOV(lua_State* L);
int SetFOV(lua_State* L);
int Lerp(lua_State* L);
int CatmullRom(lua_State* L);
static void Bind();
};
class Model_BindLua :public Transform_BindLua
{
public:
Model * model;
static const char className[];
static Luna<Model_BindLua>::FunctionType methods[];
static Luna<Model_BindLua>::PropertyType properties[];
Model_BindLua(Model* model);
Model_BindLua(lua_State* L);
~Model_BindLua();
static void Bind();
};
}
+5
View File
@@ -4,6 +4,9 @@
#include <vector>
namespace wiSceneComponents
{
std::atomic<uint64_t> Node::__Unique_ID_Counter = 0;
Node::Node() {
@@ -416,3 +419,5 @@ void Transform::Serialize(wiArchive& archive)
}
}
}
+5
View File
@@ -7,6 +7,9 @@
class wiArchive;
namespace wiSceneComponents
{
struct Node
{
private:
@@ -85,4 +88,6 @@ struct Transform : public Node
void Serialize(wiArchive& archive);
};
}
#endif // _TRANSFORM_H_
+1
View File
@@ -4,6 +4,7 @@
#include "wiMath.h"
using namespace wiGraphicsTypes;
using namespace wiSceneComponents;
GPUBuffer* wiTranslator::vertexBuffer_Axis = nullptr;
GPUBuffer* wiTranslator::vertexBuffer_Plane = nullptr;
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "CommonInclude.h"
#include "wiLoader.h"
#include "wiSceneComponents.h"
class wiTranslator : public Transform
class wiTranslator : public wiSceneComponents::Transform
{
private:
XMFLOAT4 prevPointer;
+2
View File
@@ -9,6 +9,8 @@
#include <DirectXCollision.h>
#include <sstream>
using namespace std;
using namespace wiGraphicsTypes;
+1 -1
View File
@@ -25,7 +25,7 @@ struct wiEventArgs
std::string sValue;
};
class wiWidget : public Transform
class wiWidget : public wiSceneComponents::Transform
{
friend class wiGUI;
public: