Commit Graph

16 Commits

Author SHA1 Message Date
Nathan Lovato
a2d0258ff1 Update doc-comments to use JSDoc style 2020-04-02 18:31:59 -06:00
Francois Belair
89e4dc4c2b Fix velocity reversal bug in kinematic agents
Fixes #40
2020-03-19 23:34:51 -04:00
Francois Belair
192490b757 Make agents multiply acceleration by delta
This fixes the fact that acceleration wasn't treated as acceleration
  over time, but was instant acceleration.
2020-03-03 14:47:03 -05:00
Francois Belair
2d3e763a80 Add category tags to API 2020-02-22 12:51:11 -05:00
Francois Belair
fbb92e3593 Replace body with WeakRef of body to fix crashes
When a physics body was freed by queue_free or free, it was possible
for the physics update to still happen on the specialized agent. The
Null body then caused a crash.
2020-02-20 12:24:55 -05:00
Nathan Lovato
68b85bb234 Format the code using gdformat
gdformat follows the official style guide, and handles line length and wrapping
lines for us.
2020-02-14 10:35:18 -06:00
Francois Belair
ca1839c633 Add 3D demo and fix 3D agents
Closes #30, closes #31, closes #33
2020-02-13 03:51:48 -05:00
Nathan Lovato
36f2dcb522 Handle all warnings in GSAI* classes and demos 2020-02-11 13:36:06 -06:00
Nathan Lovato
6d2016c9e9 Handle and remove warnings in GSAI* classes 2020-02-11 13:18:22 -06:00
Nathan Lovato
7e98b2e785 Rename 3D physics body classes to *3DAgent 2020-02-11 12:56:24 -06:00
Nathan Lovato
7eb91a6165 Use GSAI as a class prefix instead of GST
GSAI for Godot Steering AI
2020-02-11 11:33:25 -06:00
Francois Belair
7329758fd4 Add demo selector as main scene
Closes #20
2020-02-08 01:52:10 -05:00
Francois Belair
dc9a57e7fd Append _ to apply_steering and fix yield on ready 2020-02-07 09:56:03 -05:00
Răzvan C. Rădulescu
1baed58659 Review smart agents
I made minimal changes, mostly cosmetic like so:

- rename KinematicMovementType to MovementType since
  GSTKinematicBody2DAgent.KinematicMovementType.COLLIDE for example is
  really more than a mouthful with repeated Kinematic in the name
- add optional movement_type parameter to the constructor, otherwise
  we'd be forced to construct the object and then specify as an
  aditional step the type of movement if we want something else than the
  default
- rewrote the constructor to yield on ready and removed _on_body_ready
- renamed _apply_steering to apply_steering as this is a public method
- renamed _on_SceneTree_frame to _on_SceneTree_physics_frame
2020-02-07 12:29:45 +02:00
Francois Belair
2ae06d3da3 Split agent types into specialized classes 2020-02-06 16:30:53 -05:00
Francois Belair
85784791ec Add and have most demos use specialized agents
The agents auto-update themselves and can calculate their velocities.
This keeps the user from having to create an update_agent function.
It can also save the user from having to keep track of and update
velocities at all by using the provided `apply_steering` method.

Closes #15, closes #16
2020-02-06 16:00:41 -05:00