I´m not sure whether this is normal for EntityYaw() or not, so first I post my code here before I do a bugreport.
I discovered something, hmm, unnormal. Just run the code below.
Keep in mind: Adjusted is the value you can use a second time for same orientation of both entities.
So, what we expect: All 3 cubes get a different angle. Now look at them; All 3 got a different direction/angle.
But what we get with EntityYaw(cubeEnt, #PB_Absolute | #PB_Engine3D_Adjusted) is that cube No.1 and No.3 have the same directionangle.
As I said, I´m not sure, but for me #PB_Engine3D_Adjusted is a thing we should not use...
Because I only get the same direction with the #PB_Engine3D_Raw angle.
So, what do you think about it? Is this normal or bugrelated?
Greets,
Bananenfreak
Code: Select all
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>> >>
;>> Name: Staticgeometryversuch>>
;>> >>
;>> Author: (c) Bananenfreak >>
;>> >>
;>> Date: 12.09.2014 >>
;>> >>
;>> OS: Windows >>
;>> >>
;>> >>
;>> >>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EnableExplicit
Define.f KeyX, KeyY, MouseX, MouseY
Define nx.f, nz.f, Boost.f = 1, Yaw.f, Pitch.f
Define.i Quit, boden, cube, cubeEnt, cubeEnt1, cubeEnt2
#kam_0 = 0
#window = 0
#plane = 0
#planent = 0
If InitEngine3D()
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Scripts", #PB_3DArchive_FileSystem)
Parse3DScripts()
InitSprite()
InitKeyboard()
InitMouse()
OpenWindow(#window, 0, 0, 1800, 1000, "3D-Template", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#window), 10, 10, 2000, 2000, 0, 10, 10, #PB_Screen_SmartSynchronization)
WorldShadows(#PB_Shadow_TextureAdditive, 200, RGB(255 * 0.2, 255 * 0.2, 255 * 0.2), 4096)
AmbientColor(RGB(255 * 0.2, 255 * 0.2, 255 * 0.2))
CreatePlane(#plane, 100, 100, 100, 100, 100, 100)
boden = GetScriptMaterial(#PB_Any, "Scene/GroundBlend")
CreateEntity(#planent, MeshID(#plane), MaterialID(boden), 0, 0, 0)
cube = CreateCube(#PB_Any, 2.0)
cubeEnt = CreateEntity(#PB_Any, MeshID(cube), #PB_Material_None, 0, 1, 0)
RotateEntity(cubeEnt, 0, 60, 0, #PB_Relative)
cubeEnt1 = CreateEntity(#PB_Any, MeshID(cube), #PB_Material_None, 5, 1, 0)
RotateEntity(cubeEnt1, 0, 90, 0, #PB_Relative)
cubeEnt2 = CreateEntity(#PB_Any, MeshID(cube), #PB_Material_None, 10, 1, 0)
RotateEntity(cubeEnt2, 0, 120, 0, #PB_Relative)
Debug "Cube1, Adjusted: " + EntityYaw(cubeEnt, #PB_Absolute | #PB_Engine3D_Adjusted)
Debug "Cube2, Adjusted: " + EntityYaw(cubeEnt1, #PB_Absolute | #PB_Engine3D_Adjusted)
Debug "Cube3, Adjusted: " + EntityYaw(cubeEnt2, #PB_Absolute | #PB_Engine3D_Adjusted)
Debug "Cube3, Raw: " + EntityYaw(cubeEnt2, #PB_Absolute | #PB_Engine3D_Raw)
;-Camera
CreateCamera(#kam_0, 0, 0, 100, 100)
MoveCamera(#kam_0, 0, 20, 0, #PB_Absolute)
CameraLookAt(#kam_0, 20, 0, 20)
CameraRange (#kam_0, 2, 5000)
CameraFOV (#kam_0, 90)
CameraBackColor(#kam_0, RGB(0, 0, 0))
Repeat
Repeat
Until WindowEvent() = 0
If ExamineMouse()
Yaw = -MouseDeltaX() * 0.05
Pitch = -MouseDeltaY() * 0.05
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Up)
MoveCamera(0, 0, 0, -1 * Boost)
ElseIf KeyboardPushed(#PB_Key_Down)
MoveCamera(0, 0, 0, 1 * Boost)
EndIf
If KeyboardPushed(#PB_Key_Left)
MoveCamera(0, -1 * Boost, 0, 0)
ElseIf KeyboardPushed(#PB_Key_Right)
MoveCamera(0, 1 * Boost, 0, 0)
EndIf
EndIf
RotateCamera(0, Pitch, Yaw, 0, #PB_Relative)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
Else
MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf
End
