Commit Graph
165 Commits
Author SHA1 Message Date
Baezon 256a047fab fix rand circle and sphere probability distribution 2021-03-12 16:13:52 -05:00
Baezon 22f7ff3443 fix bias from random_circle/sphere 2021-03-11 03:02:24 -05:00
asarium d589234648 Some final changes 2021-02-24 18:04:19 +01:00
asarium 1d6052e81e Rework function handling 2021-02-22 18:02:22 +01:00
Goober5000 dd92a0f0bb add vm_vec_is_normalized and use it in several places 2021-02-06 13:46:54 -05:00
Baezon fc7e1f0e40 improve comment on delta_ang 2021-01-03 22:51:17 -05:00
Goober5000 cda9967d9c add vecmat function 2020-12-30 00:35:22 -05:00
JohnAFernandez 186fe51344 Object update packet upgrade (#2752)
* Object Update Refactor

    1. Keeps the object update packet aligned, even if the ship is dying or has not yet arrived on the client.
    2. Properly handles model point shields (yes, that's what was causing multi to crash the most!)
    3. Reworks positional interpolation timing and adds rotational interpolation, by sending timing information with every object update packet in a header shared between objects.
    4. Saves a lot of bandwidth by only sending data that is changing. (no more sending all subsystems once per second!)
    5. Better handles out of order packets (but can still use their information if recent enough!)
    6. Builds the basis for Rollback by beginning to record the positions and orientations and velocities of ships for the last 30 frames.
    7. Adds subsystem rotation -- Yeah, you saw that right, subsystems will now spin in multi.
    8. Waypoint movement is now enabled via sexp, and time to arrival of waypoints is updated on the target info gauge.

* Fix edge case crash and Incorporate feedback

* Clean Up Interpolate Angles Quick

* Restrain the client

* How was this still here???

* Make sure every part of OO uses OOC_INDEX_NULLPTR_SUBSYSTEM define

* Fix Way to Store Return Values

* Ok travis, we get it

* Ok travis.........
2020-10-08 15:29:06 -04:00
asarium b4350a1d1e Fix GCC-10 warnings
This fixes some warnings reported by GCC 10 and enables that compiler to
be used by our CI pipelines.

This fixes #2773.
2020-10-02 18:49:01 +02:00
Goober5000 67ea05fefd add some vector scripting functions
createRandomVector
perturb (for vectors)
perturb (for matrixes)
randomInCircle
randomInSphere
2020-08-30 09:36:24 -04:00
Goober5000 13bb92348f Merge pull request #2640 from Baezon/orthogonalize
Improve vm_orthogonalize_matrix safety
2020-08-25 00:42:25 -04:00
Baezon dc413f2168 history comments 2020-08-24 01:01:37 -04:00
Baezon 32665e0028 overshoot padding 2020-08-24 00:50:42 -04:00
Baezon 132bcda055 comments for old names 2020-08-24 00:50:42 -04:00
Baezon 338e049cb1 renaming of functions 2020-08-24 00:50:42 -04:00
Baezon 29b30ab7ad just about ready 2020-08-24 00:50:42 -04:00
Baezon d5b70260e7 almost there 2020-08-24 00:50:00 -04:00
Baezon 0fada393fc wip
version 1

version 2
2020-08-24 00:50:00 -04:00
Baezon c5cf8621a2 expose maybe_normalize and use machine epsilon 2020-08-24 00:11:20 -04:00
Baezon 0857f67875 v1 2020-08-20 20:50:04 -04:00
Baezon 666c2a4402 bool valid vec 2020-08-10 22:31:44 -04:00
Baezon d48559d455 double the doubles 2020-08-10 19:09:17 -04:00
Baezon d92c7a8ea3 doubles for inverting 2020-08-10 15:02:12 -04:00
Baezon 7e42b36d4a nullptr 2020-08-08 23:26:21 -04:00
Baezon 2b92e10e15 clean up 2020-08-08 21:58:40 -04:00
Baezon c8cb3d45fc orthogonalize safety 2020-08-08 15:55:33 -04:00
Goober5000 6e40248490 add vector interpolation, sexp variable name, and joystick axis inversion
add several more vecmat functions to scripting
2020-07-23 14:43:02 -04:00
Fabian Woltermann fd2f9cc326 Merge pull request #2570 from Goober5000/vm_vec_mag_quicker
make _quick quicker
2020-07-18 18:55:57 +02:00
Baezon 8de1248713 no infinite vectors allowed 2020-07-15 01:10:47 -04:00
Goober5000 815de46c6d make _quick quicker
The functions derived from `vm_vec_mag_quick` run *slower* than `vm_vec_mag`, according to @Baezon who did some testing.  So this PR makes all calls to the _quick functions use their more accurate counterparts.
2020-07-13 20:49:50 -04:00
Baezon 82c13da494 Added vecmat test
also trying to placate appveyor by using a variable instead of a literal i guess?
2020-07-09 00:34:25 -04:00
Baezon f4794341bb bugfix 2020-07-08 01:32:49 -04:00
Baezon f1a3ac449e Addition of matrix3 functions in vecmat
Added inverse, add, add2, sub, sub2 and a ZERO_MATRIX.
2020-07-08 00:51:06 -04:00
JohnAFernandez c43fa8c9a8 Add an angles version of zero vector and identity matrix 2020-04-25 00:45:34 -04:00
JohnAFernandez 790949b527 vecmat.cpp quick cleanup
A few early on descriptions in this file are inconsistent or even plain wrong.  This should correct that.

Also, rename vm_vec_imag() to vm_vec_inv_mag_quick() to better describe what it is.
2020-01-05 20:29:59 -05:00
wookieejedi e519646e28 Optimized a bit
Tried a few different things and still can't find a way to remove the square-root unforuntealy.
2019-11-29 17:49:22 -05:00
wookieejedi 48773e3099 Fixes the extraction of pitch
It turns out that `angles_2_matrix ` would return a pitch value that was not the actual pitch from the 3x3 matrix. The pitch line in the code is uses a modifed `cosp` as the demoninator to calculate the pitch angle. I looked up online what the caclulation should be and found a more accurate way than using the modifed cosp, is to use ( fvec.xyz.x^2 + fvec.xyz.z^2 )^0.5 I tested using the new calculation throughouly and in each test it returned the proper pitch value from the 3x3 orientation matrix.
2019-11-29 16:31:41 -05:00
z64555 1fb194a729 Use vmd_zero_vector instead of ZERO_VECTOR in places that expect an actual vector.
Refactor plotBlip() a bit.
Rename the variable 'blip' in clampBlip() to the more generic 'b'
Use 'hypotf' instead of '_hypotf'
2019-11-10 13:49:30 -05:00
z64555 082304a4b8 Adds function to find the intersection of two lines 2019-11-10 13:49:27 -05:00
Fabian Woltermann c2c8acbf13 REdo properly 2018-08-20 17:12:38 +02:00
Fabian Woltermann ac58950ac5 Revert "vm_vec_random_cone needs to be called with the smaller angle first."
This reverts commit 5b01036723.
2018-08-20 17:10:31 +02:00
Fabian Woltermann 5b01036723 vm_vec_random_cone needs to be called with the smaller angle first.
This also adds a check to that function to swap the values around should that not be the case
2018-08-10 17:26:42 +02:00
TRBlount 1c2a136ef7 Fix vm_vec_random_cone/sphere functions 2018-07-28 09:11:59 -06:00
Fabian Woltermann 51557d3aa3 remove extra braces 2018-07-01 09:00:36 +02:00
Fabian Woltermann 521a9b9461 Downgrade the null vec3d in vec3d normalize warning to a log print 2018-07-01 08:59:27 +02:00
asarium eeed22b91a Enable misc-unused-parameters
clang-tidy was used for fixing the warnings. It is not clear if this is
actually an improvement so this may still be disabled later.
2018-04-25 11:57:55 +02:00
asarium 0b4ca71eba Enable modernize-deprecated-headers 2018-04-25 11:12:41 +02:00
asarium 99f69c903e Add screen space decal rendering system
This allows to render screen space decals into the deferred lighting
buffers no matter how complex the underlying geometry is.

Currently there is only limited support for using this in the engine.
Only weapon impact decals are supported at the moment for testing
purposes.
2018-01-12 17:09:49 +01:00
asarium c6975fda3c Use uniform buffer blocks for passing uniform data to shaders
This uses UBOs for building a buffer object of uniform data before
using that data to draw objects. This should reduce the CPU overhead by
reducing the amount of glUniform calls required for executing a single
draw call. This is especially useful if rendering is limited by the CPU
which should help performance for people with slower CPUs.

This fixes #910.
2017-09-13 11:54:16 +02:00
Peter Mitsis f448150156 vecmat: Fix vm_test_parallel()
Fixes a subtle problem with vm_test_parallel() wherein a relative error
was accidentally converted into an absolute error.

Instead of comparing the result of the cross product to the zero vector,
the two calculated components of the cross product are compared against
each other. This permits vectors whose cross product is a large number
but whose cross product partials are within relative error of each other
to be treated as parallel.

For example, the following two vectors may now be considered as parallel
whereas before they were not:
   v1 = (1000004.0, 1.0, 1.0)
   v2 = (1000000.0, 1.0, 1.0)
The relative difference between them is sufficiently small according to
vm_vec_equal() for them to be considered equal, but their cross product
would have elements whose magnitudes would be near 4.0 which would
otherwise indicate that they are not parallel. By comparing the partials
instead, a higher degree of consistency is maintained.

Signed-off-by: Peter Mitsis <[email protected]>
2017-02-12 11:04:38 -05:00