Skip to content

Commit e14ff86

Browse files
committed
feat: update cars to latest cubos version
1 parent aa7d803 commit e14ff86

File tree

8 files changed

+490
-477
lines changed

8 files changed

+490
-477
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endfunction()
2222

2323
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize-recover=address")
2424

25-
#add_subdirectory(cars)
25+
add_subdirectory(cars)
2626
#add_subdirectory(tanks)
2727
#add_subdirectory(scraps)
2828
#add_subdirectory(airships)

cars/CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# cars/CMakeLists.txt
22
# Cars demo build configuration
33

4-
option(CARS_DISTRIBUTE "Build the game for distribution" OFF)
5-
64
add_executable(cars
75
src/car/car.cpp
86
src/car/plugin.cpp
@@ -50,3 +48,17 @@ else()
5048
)
5149
endif()
5250
endif()
51+
52+
# ------------------------ Configure game installation ------------------------
53+
54+
if(DISTRIBUTE)
55+
if(EMSCRIPTEN)
56+
install(FILES $<TARGET_FILE_DIR:cars>/cars.html DESTINATION cars)
57+
install(FILES $<TARGET_FILE_DIR:cars>/cars.wasm DESTINATION cars)
58+
install(FILES $<TARGET_FILE_DIR:cars>/cars.js DESTINATION cars)
59+
else()
60+
install(TARGETS cars EXPORT cars RUNTIME DESTINATION cars)
61+
endif()
62+
install(DIRECTORY assets/ DESTINATION cars/assets)
63+
install(DIRECTORY ${CUBOS_ENGINE_ASSETS_PATH}/ DESTINATION cars/builtin)
64+
endif()

cars/assets/scenes/car.cubos

Lines changed: 84 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,94 @@
11
{
2-
"entities": {
3-
"car": {
4-
"cubos::engine::BoxCollisionShape": {
5-
"x": 7.5,
6-
"y": 11.0,
7-
"z": 16.0
8-
},
9-
"cubos::engine::Collider": {},
10-
"cubos::engine::Position": {
11-
"x": 0.0,
12-
"y": 0.0,
13-
"z": 0.0
14-
},
15-
"cubos::engine::RenderVoxelGrid": {
16-
"asset": "059c16e7-a439-44c7-9bdc-6e069dba0c75",
17-
"offset": {
18-
"x": -7.5,
19-
"y": 0.0,
20-
"z": -16.0
21-
}
22-
},
23-
"cubos::engine::Rotation": {
24-
"w": 1.0,
25-
"x": 0.0,
26-
"y": 0.0,
27-
"z": 0.0
28-
},
29-
"cubos::engine::Scale": 0.10000000149011612
2+
"cubos::engine::CollisionLayers": 1,
3+
"cubos::engine::CollisionMask": 3,
4+
"cubos::engine::BoxCollisionShape": {
5+
"x": 7.5,
6+
"y": 11.0,
7+
"z": 16.0
8+
},
9+
"cubos::engine::Position": {
10+
"x": 0.0,
11+
"y": 0.0,
12+
"z": 0.0
13+
},
14+
"cubos::engine::RenderVoxelGrid": {
15+
"asset": "059c16e7-a439-44c7-9bdc-6e069dba0c75",
16+
"offset": {
17+
"y": 0.0
18+
}
19+
},
20+
"cubos::engine::Rotation": {
21+
"w": 1.0,
22+
"x": 0.0,
23+
"y": 0.0,
24+
"z": 0.0
25+
},
26+
"cubos::engine::Scale": 0.10000000149011612,
27+
"#left-spot-light": {
28+
"cubos::engine::Position": {
29+
"x": -4.0,
30+
"y": 4.0,
31+
"z": 15.0
3032
},
31-
"left-spot-light": {
32-
"cubos::engine::Position": {
33-
"x": -4.0,
34-
"y": 4.0,
35-
"z": 15.0
36-
},
37-
"cubos::engine::Rotation": {
38-
"x": 0.0,
39-
"y": 0.0,
40-
"z": 0.0,
41-
"w": 1.0
42-
},
43-
"cubos::engine::Scale": 1.0,
44-
"cubos::engine::SpotLight": {
45-
"color": {
46-
"x": 1.0,
47-
"y": 1.0,
48-
"z": 1.0
49-
},
50-
"innerSpotAngle": 60.0,
51-
"intensity": 0.0,
52-
"range": 50.0,
53-
"spotAngle": 120.0
54-
},
55-
"cubos::engine::SpotShadowCaster": {},
56-
"cubos::engine::ChildOf@car": {}
33+
"cubos::engine::Rotation": {
34+
"x": 0.0,
35+
"y": 0.0,
36+
"z": 0.0,
37+
"w": 1.0
5738
},
58-
"right-spot-light": {
59-
"cubos::engine::Position": {
60-
"x": 4.0,
61-
"y": 4.0,
62-
"z": 15.0
63-
},
64-
"cubos::engine::Rotation": {
65-
"x": 0.0,
66-
"y": 0.0,
67-
"z": 0.0,
68-
"w": 1.0
69-
},
70-
"cubos::engine::Scale": 1.0,
71-
"cubos::engine::SpotLight": {
72-
"color": {
73-
"x": 1.0,
74-
"y": 1.0,
75-
"z": 1.0
76-
},
77-
"innerSpotAngle": 60.0,
78-
"intensity": 0.0,
79-
"range": 50.0,
80-
"spotAngle": 120.0
39+
"cubos::engine::Scale": 1.0,
40+
"cubos::engine::SpotLight": {
41+
"color": {
42+
"x": 1.0,
43+
"y": 1.0,
44+
"z": 1.0
8145
},
82-
"cubos::engine::ChildOf@car": {}
46+
"innerSpotAngle": 60.0,
47+
"intensity": 0.0,
48+
"range": 50.0,
49+
"spotAngle": 120.0
8350
},
84-
"camera": {
85-
"cubos::engine::Position": {
86-
"x": 0.0,
87-
"y": 30.0,
88-
"z": -80.0
89-
},
90-
"cubos::engine::Rotation": {
91-
"x": 0.0,
51+
"cubos::engine::SpotShadowCaster": {}
52+
},
53+
"#right-spot-light": {
54+
"cubos::engine::Position": {
55+
"x": 4.0,
56+
"y": 4.0,
57+
"z": 15.0
58+
},
59+
"cubos::engine::Rotation": {
60+
"x": 0.0,
61+
"y": 0.0,
62+
"z": 0.0,
63+
"w": 1.0
64+
},
65+
"cubos::engine::Scale": 1.0,
66+
"cubos::engine::SpotLight": {
67+
"color": {
68+
"x": 1.0,
9269
"y": 1.0,
93-
"z": 0.0,
94-
"w": 0.0
70+
"z": 1.0
9571
},
96-
"cubos::engine::PerspectiveCamera": 70.0,
97-
"cubos::engine::ChildOf@car": {}
72+
"innerSpotAngle": 60.0,
73+
"intensity": 0.0,
74+
"range": 50.0,
75+
"spotAngle": 120.0
9876
}
9977
},
100-
"imports": {}
78+
"#camera": {
79+
"cubos::engine::Position": {
80+
"x": 0.0,
81+
"y": 30.0,
82+
"z": -80.0
83+
},
84+
"cubos::engine::Rotation": {
85+
"x": 0.0,
86+
"y": 1.0,
87+
"z": 0.0,
88+
"w": 0.0
89+
},
90+
"cubos::engine::PerspectiveCamera": {
91+
"fovY": 70.0
92+
}
93+
}
10194
}

0 commit comments

Comments
 (0)