new ver
parent
eea0b62112
commit
5264e113c3
|
@ -1,4 +1,4 @@
|
||||||
// ddraw demo: fps camera, renderdd, collide, math, ui, fx
|
// ddraw demo: fps camera, renderdd, collide, math, ui, fx, boids
|
||||||
// - rlyeh, public domain.
|
// - rlyeh, public domain.
|
||||||
//
|
//
|
||||||
// Compile with:
|
// Compile with:
|
||||||
|
@ -8,8 +8,9 @@
|
||||||
#include "v4k.h"
|
#include "v4k.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
bool do_boids_demo = 1;
|
||||||
bool do_colliders_demo = 1;
|
bool do_colliders_demo = 1;
|
||||||
bool do_debugdraw_demo = 0;
|
bool do_debugdraw_demo = 1;
|
||||||
|
|
||||||
// 75% size, MSAAx2
|
// 75% size, MSAAx2
|
||||||
window_create(75.0, WINDOW_MSAA2);
|
window_create(75.0, WINDOW_MSAA2);
|
||||||
|
@ -60,7 +61,7 @@ int main() {
|
||||||
|
|
||||||
// boids
|
// boids
|
||||||
static swarm_t sw;
|
static swarm_t sw;
|
||||||
profile("boids") {
|
if( do_boids_demo ) profile("boids") {
|
||||||
do_once sw = swarm();
|
do_once sw = swarm();
|
||||||
do_once array_push(sw.steering_targets, vec3(0,0,0));
|
do_once array_push(sw.steering_targets, vec3(0,0,0));
|
||||||
do_once for(int i = 0; i < 100; ++i)
|
do_once for(int i = 0; i < 100; ++i)
|
||||||
|
@ -91,6 +92,7 @@ int main() {
|
||||||
|
|
||||||
// ui
|
// ui
|
||||||
if( ui_panel("App", 0) ) {
|
if( ui_panel("App", 0) ) {
|
||||||
|
ui_bool("Boids demo", &do_boids_demo);
|
||||||
ui_bool("Collide demo", &do_colliders_demo);
|
ui_bool("Collide demo", &do_colliders_demo);
|
||||||
ui_bool("DebugDraw demo", &do_debugdraw_demo);
|
ui_bool("DebugDraw demo", &do_debugdraw_demo);
|
||||||
ui_panel_end();
|
ui_panel_end();
|
||||||
|
|
|
@ -91,7 +91,7 @@ int main() {
|
||||||
array_pop_front(points);
|
array_pop_front(points);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( dist < 10 && abs(angle) > 10 ) {
|
if( dist < 10 && fabsf(angle) > 10 ) {
|
||||||
// spin only
|
// spin only
|
||||||
p->brain[ angle < 0 ? 2 : 3 ] = 1;
|
p->brain[ angle < 0 ? 2 : 3 ] = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -596,7 +596,7 @@ details > summary::-webkit-details-marker {
|
||||||
|Version: | 2023.7 |
|
|Version: | 2023.7 |
|
||||||
|:--------------|:------------|
|
|:--------------|:------------|
|
||||||
|Branch: | main |
|
|Branch: | main |
|
||||||
|Commit: | 36 |
|
|Commit: | 45 |
|
||||||
<!--| Documentation last modified | { {LAST_MODIFIED} } |-->
|
<!--| Documentation last modified | { {LAST_MODIFIED} } |-->
|
||||||
|
|
||||||
# [V·4·K 2023.7 ](https://dev.v4.games/zaklaus/v4k)
|
# [V·4·K 2023.7 ](https://dev.v4.games/zaklaus/v4k)
|
||||||
|
|
Loading…
Reference in New Issue