Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a670013
commit 0b2523b
Showing
39 changed files
with
387 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,7 @@ | |
!*.md | ||
!*.txt | ||
!*.glslp | ||
!*.anki* | ||
!*.blend | ||
!CMakeLists.txt | ||
build*/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
add_definitions(-UANKI_BUILD) | ||
add_subdirectory(simple_scene) | ||
add_subdirectory(sponza) | ||
add_subdirectory(physics_playground) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_executable(physics_playground Main.cpp ../common/Framework.cpp) | ||
target_link_libraries(physics_playground anki) | ||
|
||
installExecutable(physics_playground) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors. | ||
// All rights reserved. | ||
// Code licensed under the BSD License. | ||
// http://www.anki3d.org/LICENSE | ||
|
||
#include <cstdio> | ||
#include "../common/Framework.h" | ||
|
||
using namespace anki; | ||
|
||
class MyApp : public SampleApp | ||
{ | ||
public: | ||
Error sampleExtraInit() override | ||
{ | ||
ScriptResourcePtr script; | ||
ANKI_CHECK(getResourceManager().loadResource("assets/scene.lua", script)); | ||
ANKI_CHECK(getScriptManager().evalString(script->getSource())); | ||
return Error::NONE; | ||
} | ||
|
||
Error userMainLoop(Bool& quit) override; | ||
}; | ||
|
||
Error MyApp::userMainLoop(Bool& quit) | ||
{ | ||
ANKI_CHECK(SampleApp::userMainLoop(quit)); | ||
|
||
if(getInput().getMouseButton(MouseButton::LEFT) == 1) | ||
{ | ||
ANKI_LOGI("Firing a monkey"); | ||
|
||
static U instance = 0; | ||
|
||
Transform camTrf = getSceneGraph().getActiveCameraNode().getComponent<MoveComponent>().getWorldTransform(); | ||
|
||
ModelNode* monkey; | ||
ANKI_CHECK(getSceneGraph().newSceneNode<ModelNode>( | ||
StringAuto(getAllocator()).sprintf("monkey%u", instance++).toCString(), | ||
monkey, | ||
"assets/SuzanneMaterial-material.ankimdl")); | ||
// monkey->getComponent<MoveComponent>().setLocalTransform(camTrf); | ||
|
||
BodyNode* body; | ||
ANKI_CHECK(getSceneGraph().newSceneNode<BodyNode>( | ||
StringAuto(getAllocator()).sprintf("bmonkey%u", instance++).toCString(), body, "assets/Suzanne.ankicl")); | ||
body->getComponent<BodyComponent>().setTransform(camTrf); | ||
|
||
body->addChild(monkey); | ||
} | ||
|
||
return Error::NONE; | ||
} | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
Error err = Error::NONE; | ||
|
||
MyApp* app = new MyApp; | ||
err = app->init(argc, argv, argv[0]); | ||
if(!err) | ||
{ | ||
err = app->mainLoop(); | ||
} | ||
|
||
if(err) | ||
{ | ||
ANKI_LOGE("Error reported. Bye!"); | ||
} | ||
else | ||
{ | ||
delete app; | ||
ANKI_LOGI("Bye!!"); | ||
} | ||
|
||
return 0; | ||
} |
29 changes: 29 additions & 0 deletions
29
samples/physics_playground/assets/Material-material.ankimtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- This file is auto generated by ExporterMaterial.cpp --> | ||
<material shaderProgram="shaders/GBufferGeneric.glslp"> | ||
|
||
<mutators> | ||
<mutator name="DIFFUSE_TEX" value="0"/> | ||
<mutator name="SPECULAR_TEX" value="0"/> | ||
<mutator name="ROUGHNESS_TEX" value="0"/> | ||
<mutator name="METAL_TEX" value="0"/> | ||
<mutator name="NORMAL_TEX" value="0"/> | ||
<mutator name="PARALLAX" value="0"/> | ||
<mutator name="EMISSIVE_TEX" value="0"/> | ||
</mutators> | ||
|
||
<inputs> | ||
<input shaderInput="mvp" builtin="MODEL_VIEW_PROJECTION_MATRIX"/> | ||
<input shaderInput="rotationMat" builtin="ROTATION_MATRIX"/> | ||
|
||
|
||
<input shaderInput="diffColor" value="0.548460 0.640000 0.063144"/> | ||
<input shaderInput="specColor" value="0.500000 0.500000 0.500000"/> | ||
<input shaderInput="roughness" value="0.097847" /> | ||
<input shaderInput="metallic" value="0.000000"/> | ||
|
||
<input shaderInput="emission" value="0.000000 0.000000 0.000000"/> | ||
<input shaderInput="subsurface" value="0.000000"/> | ||
|
||
</inputs> | ||
</material> |
29 changes: 29 additions & 0 deletions
29
samples/physics_playground/assets/Material_001-material.ankimtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- This file is auto generated by ExporterMaterial.cpp --> | ||
<material shaderProgram="shaders/GBufferGeneric.glslp"> | ||
|
||
<mutators> | ||
<mutator name="DIFFUSE_TEX" value="0"/> | ||
<mutator name="SPECULAR_TEX" value="0"/> | ||
<mutator name="ROUGHNESS_TEX" value="0"/> | ||
<mutator name="METAL_TEX" value="0"/> | ||
<mutator name="NORMAL_TEX" value="0"/> | ||
<mutator name="PARALLAX" value="0"/> | ||
<mutator name="EMISSIVE_TEX" value="0"/> | ||
</mutators> | ||
|
||
<inputs> | ||
<input shaderInput="mvp" builtin="MODEL_VIEW_PROJECTION_MATRIX"/> | ||
<input shaderInput="rotationMat" builtin="ROTATION_MATRIX"/> | ||
|
||
|
||
<input shaderInput="diffColor" value="0.012172 0.367335 0.640000"/> | ||
<input shaderInput="specColor" value="0.500000 0.500000 0.500000"/> | ||
<input shaderInput="roughness" value="0.097847" /> | ||
<input shaderInput="metallic" value="0.000000"/> | ||
|
||
<input shaderInput="emission" value="0.000000 0.000000 0.000000"/> | ||
<input shaderInput="subsurface" value="0.000000"/> | ||
|
||
</inputs> | ||
</material> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<collisionShape> | ||
<type>staticMesh</type> | ||
<value>assets/Suzanne.ankimesh</value> | ||
</collisionShape> |
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
samples/physics_playground/assets/SuzanneMaterial-material.ankimdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<model> | ||
<modelPatches> | ||
<modelPatch> | ||
<mesh>assets/Suzanne.ankimesh</mesh> | ||
<material>assets/Material-material.ankimtl</material> | ||
</modelPatch> | ||
</modelPatches> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<collisionShape> | ||
<type>staticMesh</type> | ||
<value>assets/floor.ankimesh</value> | ||
</collisionShape> |
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
samples/physics_playground/assets/floorMaterial-material.ankimdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<model> | ||
<modelPatches> | ||
<modelPatch> | ||
<mesh>assets/floor.ankimesh</mesh> | ||
<material>assets/Material-material.ankimtl</material> | ||
</modelPatch> | ||
</modelPatches> | ||
</model> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<collisionShape> | ||
<type>staticMesh</type> | ||
<value>assets/walls.ankimesh</value> | ||
</collisionShape> |
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
samples/physics_playground/assets/wallsMaterial_001-material.ankimdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<model> | ||
<modelPatches> | ||
<modelPatch> | ||
<mesh>assets/walls.ankimesh</mesh> | ||
<material>assets/Material_001-material.ankimtl</material> | ||
</modelPatch> | ||
</modelPatches> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.