Skip to content

Commit

Permalink
physics work
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Paul committed Nov 7, 2024
1 parent f468435 commit d45c565
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 59 deletions.
20 changes: 14 additions & 6 deletions Sandbox/Hazel.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
[11:20:21] [warning] VORTEX: Initialized Logging !
[11:20:21] [info] APP: WELCOME! Var=10
[11:20:21] [info] VORTEX: Creating window Vortex Application (1800, 1200)
[11:20:21] [info] VORTEX: OpenGL Version: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.2
[11:20:21] [info] VORTEX: OpenGL Rendering Device is: Intel - Mesa Intel(R) Graphics (ADL GT2)
[11:20:21] [info] VORTEX: Using Default Graphics Card
[13:10:22] [warning] VORTEX: Initialized Logging !
[13:10:22] [info] APP: WELCOME! Var=10
[13:10:22] [info] VORTEX: Creating window Vortex Application (1800, 1200)
[13:10:22] [info] VORTEX: OpenGL Version: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.2
[13:10:22] [info] VORTEX: OpenGL Rendering Device is: Intel - Mesa Intel(R) Graphics (ADL GT2)
[13:10:22] [info] VORTEX: Using Default Graphics Card
[13:10:31] [trace] VORTEX: Deserializing scene 'Untitled'
[13:10:31] [trace] VORTEX: Deserialized entity with ID = 2, name = Ground
[13:10:31] [trace] VORTEX: Deserialized entity with ID = 1, name = Camera
[13:10:31] [trace] VORTEX: Deserialized entity with ID = 0, name = Object 1
[13:15:25] [trace] VORTEX: Deserializing scene 'Untitled'
[13:15:25] [trace] VORTEX: Deserialized entity with ID = 2, name = Camera
[13:15:25] [trace] VORTEX: Deserialized entity with ID = 1, name = Ground
[13:15:25] [trace] VORTEX: Deserialized entity with ID = 0, name = Object
82 changes: 46 additions & 36 deletions Sandbox/assets/Scenes/default.vx
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,66 @@ Scene: Untitled
Entities:
- Entity: 2
TagComponent:
Tag: Ground
Tag: Object
ShapeComponent:
Type: 0
TransformComponent:
Translation: [-0.081600368, 0.350560993, -0.0407602042]
Rotation: [1.5739131, 0, 0]
Scale: [5.68301725, 3.56477427, 0.999931991]
Translation: [-0.686021268, 0.786126852, -0.115785412]
Rotation: [-0.105470933, 0.216718718, 0.0033893073]
Scale: [0.999998331, 0.999995232, 0.999998927]
SpriteRendererComponent:
Color: [0.486911267, 0.678208947, 0.933852136, 1]
Color: [1, 1, 1, 1]
TextureComponent:
Texture:
Path: white texture
Tiling factor: 10
- Entity: 1
RigidbodyComponent:
BodyType: Dynamic
FixedRotation: false
BoxCollider2DComponent:
Offset: [0, 0]
Size: [0.5, 0.5]
Density: 1
Friction: 0.5
Restitution: 0
RestitutionThreshold: 0.5
- Entity: 1048577
TagComponent:
Tag: Ground
ShapeComponent:
Type: 3
TransformComponent:
Translation: [1.93560553, 0, 0]
Rotation: [0, 0, 0]
Scale: [7.88208008, 0.538874865, 9.1385746]
SpriteRendererComponent:
Color: [0.950037062, 0.766536951, 1, 1]
TextureComponent:
Texture:
Path: assets/Textures/blue.jpg
Tiling factor: 10
RigidbodyComponent:
BodyType: Static
FixedRotation: false
BoxCollider2DComponent:
Offset: [0, 0]
Size: [0.5, 0.5]
Density: 1
Friction: 0.5
Restitution: 0
RestitutionThreshold: 0.5
- Entity: 0
TagComponent:
Tag: Camera
ShapeComponent:
Type: 0
TransformComponent:
Translation: [-0.428899974, 0.778226018, 2.15242934]
Translation: [1.17616916, 1.21109784, -11.2672749]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
TextureComponent:
Texture:
Path: white texture
Path: assets/Textures/blue.jpg
Tiling factor: 10
CameraComponent:
Camera:
Expand All @@ -35,32 +70,7 @@ Entities:
PerspectiveNear: 0.00999999978
PerspectiveFar: 1000
OrthographicSize: 10
OrthographicNear: -4
OrthographicFar: 4
OrthographicNear: -20
OrthographicFar: 20
Primary: true
FixedAspectRatio: false
- Entity: 0
TagComponent:
Tag: Object 1
ShapeComponent:
Type: 0
TransformComponent:
Translation: [-0.00341035426, 1.63056648, -0.0277709942]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
SpriteRendererComponent:
Color: [1, 1, 1, 1]
TextureComponent:
Texture:
Path: white texture
Tiling factor: 10
RigidbodyComponent:
BodyType: Static
FixedRotation: false
BoxCollider2DComponent:
Offset: [0, 0]
Size: [0.5, 0.5]
Density: 1
Friction: 0.5
Restitution: 0
RestitutionThreshold: 0.5
FixedAspectRatio: false
32 changes: 16 additions & 16 deletions Sandbox/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Collapsed=0

[Window][Dear ImGui Demo]
Pos=0,24
Size=503,480
Size=500,480
Collapsed=0
DockId=0x00000006,0

Expand Down Expand Up @@ -102,7 +102,7 @@ DockId=0x00000015,1

[Window][Settings]
Pos=0,506
Size=503,865
Size=500,865
Collapsed=0
DockId=0x00000011,1

Expand All @@ -117,8 +117,8 @@ Collapsed=0
DockId=0x00000015,0

[Window][Viewport]
Pos=505,58
Size=1989,1001
Pos=502,58
Size=1992,1001
Collapsed=0
DockId=0x00000015,0

Expand All @@ -135,19 +135,19 @@ DockId=0x0000000E,0

[Window][Scene Hierachy]
Pos=0,24
Size=503,480
Size=500,480
Collapsed=0
DockId=0x00000006,1

[Window][Property]
Pos=0,506
Size=503,865
Size=500,865
Collapsed=0
DockId=0x00000011,0

[Window][Content Browser]
Pos=505,1061
Size=1989,310
Pos=502,1061
Size=1992,310
Collapsed=0
DockId=0x00000016,0

Expand All @@ -158,14 +158,14 @@ Collapsed=0
DockId=0x0000000F,0

[Window][##toolbar]
Pos=505,24
Size=1989,32
Pos=502,24
Size=1992,32
Collapsed=0
DockId=0x00000013,0

[Window][Control Flow]
Pos=0,506
Size=503,865
Size=500,865
Collapsed=0
DockId=0x00000011,2

Expand Down Expand Up @@ -312,19 +312,19 @@ DockNode ID=0x00000017 Pos=998,209 Size=1233,919 Split=X
DockNode ID=0x00000018 Parent=0x00000017 SizeRef=323,919 HiddenTabBar=1 Selected=0x45055EBD
DockNode ID=0x00000019 Parent=0x00000017 SizeRef=457,919 HiddenTabBar=1 Selected=0x02A5246D
DockSpace ID=0x3BC79352 Window=0x4647B76E Pos=0,24 Size=2494,1347 Split=X
DockNode ID=0x00000003 Parent=0x3BC79352 SizeRef=503,780 Split=Y Selected=0x1EA09189
DockNode ID=0x00000003 Parent=0x3BC79352 SizeRef=500,780 Split=Y Selected=0x1EA09189
DockNode ID=0x00000006 Parent=0x00000003 SizeRef=416,394 Selected=0x840CF92F
DockNode ID=0x00000011 Parent=0x00000003 SizeRef=416,710 Selected=0x3BF1ECBF
DockNode ID=0x00000012 Parent=0x3BC79352 SizeRef=1989,780 Split=X
DockNode ID=0x00000011 Parent=0x00000003 SizeRef=416,710 Selected=0x1EA09189
DockNode ID=0x00000012 Parent=0x3BC79352 SizeRef=1298,780 Split=X
DockNode ID=0x00000001 Parent=0x00000012 SizeRef=1549,535 Split=Y
DockNode ID=0x00000009 Parent=0x00000001 SizeRef=964,526 Split=X Selected=0x13926F0B
DockNode ID=0x0000000D Parent=0x00000009 SizeRef=549,548 Split=X Selected=0x13926F0B
DockNode ID=0x00000007 Parent=0x0000000D SizeRef=699,838 Split=Y Selected=0x13926F0B
DockNode ID=0x0000000F Parent=0x00000007 SizeRef=918,57 Selected=0x29FAF636
DockNode ID=0x00000010 Parent=0x00000007 SizeRef=918,445 Split=Y Selected=0x13926F0B
DockNode ID=0x00000013 Parent=0x00000010 SizeRef=918,32 HiddenTabBar=1 Selected=0xF0F70764
DockNode ID=0x00000014 Parent=0x00000010 SizeRef=918,1072 Split=Y Selected=0x13926F0B
DockNode ID=0x00000015 Parent=0x00000014 SizeRef=737,760 CentralNode=1 Selected=0x13926F0B
DockNode ID=0x00000014 Parent=0x00000010 SizeRef=918,1313 Split=Y Selected=0x13926F0B
DockNode ID=0x00000015 Parent=0x00000014 SizeRef=737,1001 CentralNode=1 Selected=0x13926F0B
DockNode ID=0x00000016 Parent=0x00000014 SizeRef=737,310 Selected=0xBF096F38
DockNode ID=0x00000008 Parent=0x0000000D SizeRef=370,838 Selected=0x766639F3
DockNode ID=0x0000000E Parent=0x00000009 SizeRef=413,548 Selected=0xCB2F3305
Expand Down
2 changes: 1 addition & 1 deletion Vortex/src/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Vortex

void Scene::OnRuntimeStart()
{
m_PhysicsWorld = new b2World({ 0.0f, -9.8f });
m_PhysicsWorld = new b2World({ 0.0f, -9.8f }); // The gravity

auto view = m_registry.view<Rigidbody2DComponent>();
for (auto e : view)
Expand Down

0 comments on commit d45c565

Please sign in to comment.