-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathegp3dtracker.txt
More file actions
32 lines (21 loc) · 1.2 KB
/
egp3dtracker.txt
File metadata and controls
32 lines (21 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@name EGP 3D Tracker Example
@inputs EGP:wirelink Entity:entity
#[ ]#
## E2 Example: EGP 3D Trackers ##
## ##
## Shows how to parent a 3D tracker and EGP ##
## object to an entity in the world. ##
## ##
## Link EGP to an EGP HUD to demo this E2 ##
#[ ]#
if( first() & !Entity:isValid() ){
Entity = entity() # set the default entity for this example to be the E2 chip
}
if( ~EGP | ~Entity | first() ){ # if setup hasn't been run yet...
EGP:egp3DTracker( 1, vec() ) # place a 3d tracker with no offset
EGP:egpParent( 1, Entity ) # parent the tracker to the entity
EGP:egpCircle( 2, vec2(0,0), vec2(5,5) ) # create a circle at (0,0) (centered on the tracker)
EGP:egpParent( 2, 1 ) # parent the circle to the tracker
# Trackers are better for tracking entities in 3D since they partially run clientside (look mom, no runontick!)
# Unfortunately, this means you can't use egpPos() to GET the position of trackers or their child objects
}