Merge branch 'master' of github.com:Faerbit/swp
This commit is contained in:
commit
7f475140b5
@ -3,7 +3,7 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
|
|||||||
add_subdirectory(converter)
|
add_subdirectory(converter)
|
||||||
|
|
||||||
# project/binary name:
|
# project/binary name:
|
||||||
PROJECT(MarbleRaceGroupC)
|
PROJECT(saxum)
|
||||||
|
|
||||||
# ACGL setup
|
# ACGL setup
|
||||||
SET(ACGL_OPENGL_SUPPORT CORE_32)
|
SET(ACGL_OPENGL_SUPPORT CORE_32)
|
||||||
@ -146,5 +146,5 @@ SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_LUA_BRIDGE})
|
|||||||
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/lua/src/liblua.a)
|
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/lua/src/liblua.a)
|
||||||
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(MarbleRaceGroupC ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES})
|
ADD_EXECUTABLE(saxum ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES})
|
||||||
TARGET_LINK_LIBRARIES(MarbleRaceGroupC ${LIBRARIES} ${CMAKE_DL_LIBS})
|
TARGET_LINK_LIBRARIES(saxum ${LIBRARIES} ${CMAKE_DL_LIBS})
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<farPlane>150.0</farPlane>
|
<farPlane>150.0</farPlane>
|
||||||
|
|
||||||
<maxShadowRenderCount>10</maxShadowRenderCount>
|
<maxShadowRenderCount>5</maxShadowRenderCount>
|
||||||
|
|
||||||
<compositionsPath>data/levels/Compositions.xml</compositionsPath>
|
<compositionsPath>data/levels/Compositions.xml</compositionsPath>
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>marbleSmooth.obj</modelPath>
|
<modelPath>marbleSmooth.obj</modelPath>
|
||||||
<texturePath>marbleTexture.png</texturePath>
|
<texturePath>marbleTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.5</diffuseFactor>
|
<diffuseFactor>0.5</diffuseFactor>
|
||||||
<specularFactor>0.5</specularFactor>
|
<specularFactor>0.5</specularFactor>
|
||||||
<shininess>3.0</shininess>
|
<shininess>3.0</shininess>
|
||||||
@ -555,7 +555,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>block.obj</modelPath>
|
<modelPath>block.obj</modelPath>
|
||||||
<texturePath>blockTexture_small.png</texturePath>
|
<texturePath>blockTexture_small.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>2.0</shininess>
|
||||||
@ -571,7 +571,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>column.obj</modelPath>
|
<modelPath>column.obj</modelPath>
|
||||||
<texturePath>columnTexture2.png</texturePath>
|
<texturePath>columnTexture2.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>2.0</shininess>
|
||||||
@ -584,7 +584,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>torch.obj</modelPath>
|
<modelPath>torch.obj</modelPath>
|
||||||
<texturePath>torchTexture2.png</texturePath>
|
<texturePath>torchTexture2.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.3</diffuseFactor>
|
<diffuseFactor>0.3</diffuseFactor>
|
||||||
<specularFactor>0.7</specularFactor>
|
<specularFactor>0.7</specularFactor>
|
||||||
<shininess>10.0</shininess>
|
<shininess>10.0</shininess>
|
||||||
@ -598,7 +598,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>switchInner.obj</modelPath>
|
<modelPath>switchInner.obj</modelPath>
|
||||||
<texturePath>switchInnerTexture.png</texturePath>
|
<texturePath>switchInnerTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>2.0</shininess>
|
||||||
@ -626,10 +626,10 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>switchOuter.obj</modelPath>
|
<modelPath>switchOuter.obj</modelPath>
|
||||||
<texturePath>switchOuterTexture.png</texturePath>
|
<texturePath>switchOuterTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>1.0</shininess>
|
||||||
<physicType>None</physicType>
|
<physicType>None</physicType>
|
||||||
<renderable>true</renderable>
|
<renderable>true</renderable>
|
||||||
</objectData>
|
</objectData>
|
||||||
@ -638,10 +638,10 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>simpleWall.obj</modelPath>
|
<modelPath>simpleWall.obj</modelPath>
|
||||||
<texturePath>simpleWallTexture.png</texturePath>
|
<texturePath>simpleWallTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>1.0</shininess>
|
||||||
<physicType>Box</physicType>
|
<physicType>Box</physicType>
|
||||||
<width>1.2</width>
|
<width>1.2</width>
|
||||||
<height>6</height>
|
<height>6</height>
|
||||||
@ -654,7 +654,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>gate.obj</modelPath>
|
<modelPath>gate.obj</modelPath>
|
||||||
<texturePath>gateTexture.png</texturePath>
|
<texturePath>gateTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>2.0</shininess>
|
||||||
@ -670,7 +670,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>movableBlock.obj</modelPath>
|
<modelPath>movableBlock.obj</modelPath>
|
||||||
<texturePath>movableBlockTexture.png</texturePath>
|
<texturePath>movableBlockTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>2.0</shininess>
|
||||||
@ -686,7 +686,7 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>brazier.obj</modelPath>
|
<modelPath>brazier.obj</modelPath>
|
||||||
<texturePath>brazierTexture.png</texturePath>
|
<texturePath>brazierTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>1.0</shininess>
|
<shininess>1.0</shininess>
|
||||||
@ -699,10 +699,10 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>hint.obj</modelPath>
|
<modelPath>hint.obj</modelPath>
|
||||||
<texturePath>hintTexture.png</texturePath>
|
<texturePath>hintTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>1.0</shininess>
|
||||||
<physicType>TriangleMesh</physicType>
|
<physicType>TriangleMesh</physicType>
|
||||||
<dampningL>0.555</dampningL>
|
<dampningL>0.555</dampningL>
|
||||||
<dampningA>0.5</dampningA>
|
<dampningA>0.5</dampningA>
|
||||||
@ -712,10 +712,10 @@
|
|||||||
<objectData>
|
<objectData>
|
||||||
<modelPath>exit.obj</modelPath>
|
<modelPath>exit.obj</modelPath>
|
||||||
<texturePath>exitTexture.png</texturePath>
|
<texturePath>exitTexture.png</texturePath>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.6</diffuseFactor>
|
<diffuseFactor>0.6</diffuseFactor>
|
||||||
<specularFactor>0.4</specularFactor>
|
<specularFactor>0.4</specularFactor>
|
||||||
<shininess>2.0</shininess>
|
<shininess>1.0</shininess>
|
||||||
<physicType>TriangleMesh</physicType>
|
<physicType>TriangleMesh</physicType>
|
||||||
<dampningL>0.555</dampningL>
|
<dampningL>0.555</dampningL>
|
||||||
<dampningA>0.5</dampningA>
|
<dampningA>0.5</dampningA>
|
||||||
|
@ -13057,29 +13057,29 @@
|
|||||||
</ambientLight>
|
</ambientLight>
|
||||||
|
|
||||||
<fogColourDay>
|
<fogColourDay>
|
||||||
<rColour>0.10</rColour>
|
<rColour>0.57</rColour>
|
||||||
<gColour>0.14</gColour>
|
<gColour>0.80</gColour>
|
||||||
<bColour>0.14</bColour>
|
<bColour>0.98</bColour>
|
||||||
<alpha>1.0</alpha>
|
<alpha>1.0</alpha>
|
||||||
</fogColourDay>
|
</fogColourDay>
|
||||||
|
|
||||||
<fogColourRise>
|
<fogColourRise>
|
||||||
<rColour>0.60</rColour>
|
<rColour>0.88</rColour>
|
||||||
<gColour>0.14</gColour>
|
<gColour>0.38</gColour>
|
||||||
<bColour>0.14</bColour>
|
<bColour>0.38</bColour>
|
||||||
<alpha>1.0</alpha>
|
<alpha>1.0</alpha>
|
||||||
</fogColourRise>
|
</fogColourRise>
|
||||||
|
|
||||||
<fogColourNight>
|
<fogColourNight>
|
||||||
<rColour>0.05</rColour>
|
<rColour>0.09</rColour>
|
||||||
<gColour>0.07</gColour>
|
<gColour>0.1</gColour>
|
||||||
<bColour>0.34</bColour>
|
<bColour>0.24</bColour>
|
||||||
<alpha>1.0</alpha>
|
<alpha>1.0</alpha>
|
||||||
</fogColourNight>
|
</fogColourNight>
|
||||||
|
|
||||||
<directionalLight>
|
<directionalLight>
|
||||||
<xOffset>-1.0</xOffset>
|
<xOffset>-1.0</xOffset>
|
||||||
<yOffset>1.5</yOffset>
|
<yOffset>-6</yOffset>
|
||||||
<zOffset>1.0</zOffset>
|
<zOffset>1.0</zOffset>
|
||||||
<rColour>1.0</rColour>
|
<rColour>1.0</rColour>
|
||||||
<gColour>1.0</gColour>
|
<gColour>1.0</gColour>
|
||||||
@ -13089,10 +13089,10 @@
|
|||||||
|
|
||||||
<terrain>
|
<terrain>
|
||||||
<texture>seamlessTerrain.png</texture>
|
<texture>seamlessTerrain.png</texture>
|
||||||
<ambientFactor>0.1</ambientFactor>
|
<ambientFactor>0.13</ambientFactor>
|
||||||
<diffuseFactor>0.8</diffuseFactor>
|
<diffuseFactor>0.8</diffuseFactor>
|
||||||
<specularFactor>0.2</specularFactor>
|
<specularFactor>0.2</specularFactor>
|
||||||
<shininess>3.0</shininess>
|
<shininess>1.0</shininess>
|
||||||
</terrain>
|
</terrain>
|
||||||
|
|
||||||
<skydome>
|
<skydome>
|
||||||
|
@ -7,15 +7,22 @@ function trigger(objectToChange)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local maxTimeDiff = 20
|
local maxTimeDiff = 30
|
||||||
local timeDiff = os.clock()- global.sunStartTime
|
local timeDiff = os.clock()- global.sunStartTime
|
||||||
if(timeDiff > maxTimeDiff)then
|
if(timeDiff > maxTimeDiff)then
|
||||||
timeDiff = maxTimeDiff
|
timeDiff = maxTimeDiff
|
||||||
end
|
end
|
||||||
timeDiff = timeDiff/maxTimeDiff
|
timeDiff = timeDiff/maxTimeDiff
|
||||||
local x = 1 - 0.3 * timeDiff
|
local x = 10
|
||||||
local y = math.sqrt(timeDiff) * 1.0 - 0.1
|
local y = -18 + math.sqrt(timeDiff) * 29
|
||||||
local z = 0.7 * timeDiff
|
local z = -8 + timeDiff * 15
|
||||||
level:setSunDirection(x,y,z)
|
level:setSunDirection(x,y,z)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--local x = 0.7 + 0.3 * timeDiff
|
||||||
|
--local y = math.sqrt(timeDiff) * 2.2 - 1.5
|
||||||
|
--local z = -0.7 - 0.7 * timeDiff
|
||||||
|
--start 1,-6,-2
|
||||||
|
--ziel 10,10,10
|
||||||
|
@ -92,11 +92,11 @@ vec4 fogColor(float dot) {
|
|||||||
if(dot<0.0) {
|
if(dot<0.0) {
|
||||||
dayFactor = 0.0;
|
dayFactor = 0.0;
|
||||||
}
|
}
|
||||||
else if(dot>0.51) {
|
else if(dot>1.0) {
|
||||||
dayFactor = 1.0;
|
dayFactor = 1.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dayFactor = sin(3*dot);
|
dayFactor = sin(1.5*dot);
|
||||||
}
|
}
|
||||||
if (dot <0.0) {
|
if (dot <0.0) {
|
||||||
return mix(fogColorNight, fogColorRise, riseFactor);
|
return mix(fogColorNight, fogColorRise, riseFactor);
|
||||||
@ -155,7 +155,7 @@ void main()
|
|||||||
if(length(directionalLightVector)>0.0f) {
|
if(length(directionalLightVector)>0.0f) {
|
||||||
vec3 directionalVector = normalize(directionalLightVector);
|
vec3 directionalVector = normalize(directionalLightVector);
|
||||||
sunAngle = dot(vec3(0.0, 1.0, 0.0), directionalVector);
|
sunAngle = dot(vec3(0.0, 1.0, 0.0), directionalVector);
|
||||||
if ( sunAngle > -0.5) {
|
if ( sunAngle > -0.7) {
|
||||||
float directionalVisibility = 1.0f;
|
float directionalVisibility = 1.0f;
|
||||||
if (distanceToBorder(shadowCoord1.xy) <= 0.5 && distanceToBorder(shadowCoord1.xy) > 0.2) {
|
if (distanceToBorder(shadowCoord1.xy) <= 0.5 && distanceToBorder(shadowCoord1.xy) > 0.2) {
|
||||||
if (distanceToBorder(shadowCoord0.xy) <= 0.5 && distanceToBorder(shadowCoord0.xy) > 0.2) {
|
if (distanceToBorder(shadowCoord0.xy) <= 0.5 && distanceToBorder(shadowCoord0.xy) > 0.2) {
|
||||||
|
@ -35,11 +35,11 @@ vec4 fogColor(float dot) {
|
|||||||
if(dot<0.0) {
|
if(dot<0.0) {
|
||||||
dayFactor = 0.0;
|
dayFactor = 0.0;
|
||||||
}
|
}
|
||||||
else if(dot>0.77) {
|
else if(dot>1.0) {
|
||||||
dayFactor = 1.0;
|
dayFactor = 1.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dayFactor = sin(2*dot);
|
dayFactor = sin(1.5*dot);
|
||||||
}
|
}
|
||||||
if (dot <0.0) {
|
if (dot <0.0) {
|
||||||
return mix(fogColorNight, fogColorRise, riseFactor);
|
return mix(fogColorNight, fogColorRise, riseFactor);
|
||||||
|
@ -348,7 +348,7 @@ void Graphics::render(double time)
|
|||||||
for (unsigned int i = 0; i<framebuffer_directional.size(); i++) {
|
for (unsigned int i = 0; i<framebuffer_directional.size(); i++) {
|
||||||
framebuffer_directional.at(i)->bind();
|
framebuffer_directional.at(i)->bind();
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
if (sunAngle > -0.5f) {
|
if (sunAngle > -0.7f) {
|
||||||
float projection_size = 0.0f;
|
float projection_size = 0.0f;
|
||||||
switch(i) {
|
switch(i) {
|
||||||
case 0:
|
case 0:
|
||||||
|
6
level.cc
6
level.cc
@ -19,8 +19,8 @@ Level::~Level() {
|
|||||||
}
|
}
|
||||||
for(unsigned int i = 0; i<objects.size(); i++) {
|
for(unsigned int i = 0; i<objects.size(); i++) {
|
||||||
delete(objects.at(i));
|
delete(objects.at(i));
|
||||||
delete(waterPlane);
|
|
||||||
}
|
}
|
||||||
|
delete(waterPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Level::load() {
|
void Level::load() {
|
||||||
@ -60,12 +60,14 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
|
|||||||
for(unsigned int i = 0; i<objects.size(); i++) {
|
for(unsigned int i = 0; i<objects.size(); i++) {
|
||||||
if (lightingPass) {
|
if (lightingPass) {
|
||||||
objects.at(i)->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
objects.at(i)->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
||||||
waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs);
|
objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (lightingPass) {
|
||||||
|
waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed) {
|
void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed) {
|
||||||
|
@ -145,7 +145,7 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa
|
|||||||
water_vao->bind();
|
water_vao->bind();
|
||||||
water_vao->setMode(GL_TRIANGLES);
|
water_vao->setMode(GL_TRIANGLES);
|
||||||
water_vao->attachAllAttributes(water_ab);
|
water_vao->attachAllAttributes(water_ab);
|
||||||
Material water_material = Material(waterTexture, 0.1f, 0.2f, 0.8f, 5.0f, true);
|
Material water_material = Material(waterTexture, 0.13f, 0.5f, 0.5f, 10.0f, true);
|
||||||
Object* water_object = new Object(water_vao, water_material, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), true);
|
Object* water_object = new Object(water_vao, water_material, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), true);
|
||||||
level->setWaterPlane(water_object);
|
level->setWaterPlane(water_object);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ void Physics::takeUpdateStep(float timeDiff)
|
|||||||
if(sinking)
|
if(sinking)
|
||||||
{
|
{
|
||||||
btVector3 currentPos = playerBall->getCenterOfMassPosition();
|
btVector3 currentPos = playerBall->getCenterOfMassPosition();
|
||||||
currentPos -= btVector3(0,0.35f*timeDiff,0);
|
currentPos -= btVector3(0,0.8f*timeDiff,0);
|
||||||
float damp = playerBall->getAngularDamping();
|
float damp = playerBall->getAngularDamping();
|
||||||
playerBall->setDamping(playerBall->getLinearDamping(),0.9);
|
playerBall->setDamping(playerBall->getLinearDamping(),0.9);
|
||||||
world->stepSimulation(timeDiff);
|
world->stepSimulation(timeDiff);
|
||||||
@ -106,7 +106,7 @@ void Physics::takeUpdateStep(float timeDiff)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
btVector3 currentPos = playerBall->getCenterOfMassPosition();
|
btVector3 currentPos = playerBall->getCenterOfMassPosition();
|
||||||
currentPos += btVector3(0,0.9f*timeDiff,0);
|
currentPos += btVector3(0,3.0f*timeDiff,0);
|
||||||
world->stepSimulation(timeDiff);
|
world->stepSimulation(timeDiff);
|
||||||
playerBall->setCenterOfMassTransform(btTransform(playerBall->getOrientation(),currentPos));
|
playerBall->setCenterOfMassTransform(btTransform(playerBall->getOrientation(),currentPos));
|
||||||
cameraBody->setCenterOfMassTransform(btTransform(btQuaternion(0,0,0,1),camPos));
|
cameraBody->setCenterOfMassTransform(btTransform(btQuaternion(0,0,0,1),camPos));
|
||||||
|
Loading…
Reference in New Issue
Block a user