32 Commits
Author SHA1 Message Date
Mike NelsonandAsteroth 070a8e18fa Adds Props as a new object type (#6836)
* First draft of prop object type

* Add prop editor dialog in FRED

* prop sexps

* lua table prop support

* lab support

* lua mission access to props

* prop collision support

* use std::optional so the object->instance id is always valid

* allow props to block suns

* minor cleanup and remove arbitrary limit. Still limited to 500 objects.

* Sort props by category

* cleanup

* implement collision hooks

* parse prop flags and further ensure props are inited and closed correctly

* Add Cyborg's multi suggestions

* fix missing header

* add props to empty slots if available

* add multi signature

* fix rebase issues and match collisions to the new multithread style

* appease Clang the Conquerer

* save/parse mission prop classes by name

* Clean up comments and finish TODOs

* fix string errors

* clang wants this to be static now

* address feedback

* address feedback

* Use model num from prop info instead

* merge prop and ship collision group sexps together

* fix rebase bug

* address feedback

* fix name shadowing

* ship heavy submodel

* clang

---------

Co-authored-by: Asteroth <[email protected]>
2026-02-16 14:41:34 +01:00
BMagnu bdde909fa6 Threading Framework & Threaded Collisions (#6814)
* Dispatch ship weapon collisions and defer handling

* multithread ship weapon collision

* properly spin

* proper memory order

* externalize generic threadpool settings

* Wait for threads to shut down

* Add result pipelining

* cleanup

* incorrect nullopt type

* randomrange todo

* parallelize ship ship collisions

* bogus debug return

* remove warnings

* clang tidy
2025-07-12 11:41:30 +02:00
Goober5000 671fe21a75 additional collision info
* Add the submodel that was hit to the On Ship Collision scripting hook.  (This will only be non-nil if the ship was the "heavy object".)
* Add a `getModel()` function to the scripted submodel object.
* Fix some incorrect documentation in `OnShipCollision`.
2024-03-12 13:02:58 -04:00
Birk Magnussen 1f9a2ca4ce Increase collision pair cache bitshift 2024-02-26 20:53:46 +01:00
Asteroth b1fd9ffffb Improve performance of collision retiming (#5496)
* fast version of setting position and orientation

* preliminary stale collide time

* add global collision cache stale flag instead

* clean up

* more clean up

* no periods >.>

* bring back single object version

* rename and bring back stale object list

* use a set
2023-07-18 00:28:49 -04:00
Goober5000 c72b8b0cf4 some refinements for retiming of object collision pairs
1. Add a function to retime *only* the collision pairs involving a specific object.  This is useful when only one object has moved, since only collisions involving that object are affected.
2. Use this function when objects are moved for autopilot, via sexp, and via script.

Previously collision pairs were not retimed when objects were moved via script, leading to bugs.  This fixes that.
2023-06-04 16:04:53 -04:00
Goober5000 1feef8ff2a improve spawn collision checking
Take into account the collision flag and collision groups when spawning a ship.  Should fix #5357.

Also clean up the code a bit, including setting a few `int`s to `bool`s and adding a missing axis case.
2023-04-20 22:31:34 -04:00
Asteroth 3047a226a3 Better account for runtime gravity changes (#5130)
* better account for changing gravity

* use `obj_used_list`

* check should_be_dead
2023-01-22 14:40:13 -05:00
Goober5000 97952d6b6c refactoring in preparation for model translation
Mostly renaming of fields and functions, and moving some modelread sections into functions.  This reorganization will put the code on a better footing for the model translation feature.  No model translation code is included yet, and there should be no change in functionality.
2022-01-29 15:53:21 -05:00
Asteroth 47f84846e3 fix collision retiming to never be in the future (#3599) 2021-08-12 17:21:22 -04:00
JohnAFernandez f21b1a7ace Multiplayer Resimulation for Client Fired Linear Weapons (Rollback) (#2788)
* Multiplayer Dumbfire Rollback

This creates a packet that sends the relative position and orientation info for a primary or dumbfire missle shot.  The client creates this packet when firing those two types of weapons and sends it to the server.  The server goes back to the frame that the client fired the weapon and quicky resimulates all the frames in-between.

This includes collision detection, restoring positions, orientations and veloicties, but not subsystem orientations.

* Address Feedback

* allow clients to send subsystem info

* Check for object number not weapon number

* Readability Adjustment
2020-11-03 22:56:25 -05:00
CasparKielwein 271d3f97bd remove unused functions obj_add_pair and obj_add_pairs in object code.
These functions where not used anymore and probably made redundant
by swifties changes to the collision system in 2012.
2019-05-04 11:30:54 +02:00
CasparKielwein e70d6a89ee objcollide cleanup: declare local variables at point of first use
made some loops range based.
removed some typedef struct, as it is c++.
2019-05-04 11:30:16 +02:00
CasparKielwein 3e7e7cde00 made functions from objcollide, which are only used in .cpp local to compilation unit 2019-05-01 10:41:27 +02:00
CasparKielwein b42fc2122a Cleanup in object collide code.
A bit of small cleanups in preparation of larger scale refactoring.

remove unused member heavy_collision_cm_pos of collision info struct,
which was set in several places but never used.
2019-05-01 09:44:19 +02:00
asarium 15dc45cc0a Remove -old_collision command line option
The new system has been tested pretty thoroughly so I think it is time
to remove this option.
2018-10-21 18:36:59 +02:00
Peter Mitsis 3b4fbde8e6 collide: Apply static keyword to applicable routines
Applying the 'static' keyword to applicable routines both informs the
developer where the routine is likely to be used as well as allows the
compiler to perform additional optimizations.

Signed-off-by: Peter Mitsis <[email protected]>
2018-04-14 19:57:04 -04:00
Echelon9 1e151865d4 Fix: object/collideshipweapon.cpp:67:185: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:45:38 +10:00
Goober5000 5aa3bddf70 change object from a struct to a class, since it contains the objsnd_num field :-/
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9995 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 26f8b5fed1 make collider_pair an actual class since its constructor is called by hash_map
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9891 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Swifty c6c12fc251 go_even_faster: Improved collision detection performance by rewriting broadphase and narrowphase testing. 2012-08-11 21:14:53 +00:00
Sushi 8c6895a029 Re-added collision physics, added basic landings support (still needs some work) 2010-09-13 14:27:42 +00:00
Wanderer cd15f39847 lua handled collision groups and lua bitwise ops library 2010-01-05 18:00:01 +00:00
portej05 719825f80d The big CVS comment removal. This chops approx. 3.5mb off a full checkout.
I've tested this through compiling and through hand checking. 
Normalises line endings in ALL files to \n.
2009-06-20 08:08:20 +00:00
Kazan 4e96074988 Resolve Mantis 1281 2007-07-24 13:04:11 +00:00
taylor 44ddf3545c dynamically allocate object collision pairs 2005-10-17 05:48:18 +00:00
Goober5000 2394e9801b remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 03:35:36 +00:00
taylor 7f786136a6 s/vector/vec3d/g, better support for different compilers (Jens Granseuer) 2005-04-05 05:53:25 +00:00
Kazan 7d1c8b185d added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this 2004-08-11 05:06:36 +00:00
penguin 0c503be8d1 The big include file move 2002-08-01 01:41:11 +00:00
penguin 8f92eebd34 Warpcore CVS sync 2002-06-03 04:10:40 +00:00
penguin 663b3471b9 Volition sources -- warpcore CVS import 2002-06-03 03:26:03 +00:00