1ae8811bc4
Moved quantization out of the draw code. The laser is now quantized once per frame, and the segment data is used for both collisions and rendering. Player motion is now accounted for as well, preventing phasing through thin lasers. The overall result is more precise *and* faster collision detection.
22 lines
530 B
C
22 lines
530 B
C
/*
|
|
* This software is licensed under the terms of the MIT License.
|
|
* See COPYING for further information.
|
|
* ---
|
|
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
|
|
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@taisei-project.org>.
|
|
*/
|
|
|
|
#include "taisei.h"
|
|
|
|
#include "internal.h"
|
|
|
|
LaserInternalData lintern;
|
|
|
|
void laserintern_init(void) {
|
|
assert(lintern.segments.num_elements == 0);
|
|
dynarray_ensure_capacity(&lintern.segments, 2048);
|
|
}
|
|
|
|
void laserintern_shutdown(void) {
|
|
dynarray_free_data(&lintern.segments);
|
|
}
|