Skip to content

Commit af3291b

Browse files
authored
uni: convert tabs to spaces (#385)
1 parent abf067c commit af3291b

File tree

142 files changed

+6745
-6746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+6745
-6746
lines changed

uni/3d/animationcontroller.icn

+23-23
Original file line numberDiff line numberDiff line change
@@ -22,77 +22,77 @@ class AnimationController(
2222
#animation_track := []
2323
animation_step := 1
2424
end
25-
25+
2626
method set_skeleton(skl)
2727
skeleton := skl
2828
end
29-
29+
3030
method init_timer()
3131
a_clock:=0
3232
end
3333

3434
method set_timer(t)
35-
a_clock := t
35+
a_clock := t
3636
end
37-
37+
3838
method get_timer()
3939
return a_clock
4040
end
41-
41+
4242
method faster()
4343
animation_step +:= 1
4444
DEBUGW("animation_step:", animation_step)
4545
return animation_step
4646
end
47-
47+
4848
method slower()
4949
if animation_step > 1 then{
50-
animation_step -:= 1
51-
DEBUGW("animation_step:", animation_step)
52-
}
50+
animation_step -:= 1
51+
DEBUGW("animation_step:", animation_step)
52+
}
5353
return animation_step
5454
end
55-
55+
5656
# Do we need trk ?
5757
method set_animation_track(anim_set, trk)
5858
local bone, anim
5959
animation_track := anim_set
6060
#animation_step := anim_set.maxKey/120
6161
a_clock := 0
6262
DEBUGW("anim track set to:", anim_set.label)
63-
63+
6464
DEBUGW("mapping... animation to bones")
65-
65+
6666
every anim := ! anim_set.lsAnimation do{
6767
bone := skeleton.get_bone_by_label(anim.boneName)
6868
bone.animation := anim
6969
DEBUGW("bone:", bone.label, " TO anim:", anim.boneName)
7070
}
7171
DEBUGW("done!")
7272
end
73-
73+
7474
method calc_animation(curious)
7575
if /animation_track then fail
7676
if a_clock > animation_track.get_max_key() then{
77-
a_clock := 0
78-
#CalcAnimation(Skeletton)
77+
a_clock := 0
78+
#CalcAnimation(Skeletton)
7979
}
8080
DEBUGW("controller clock:", a_clock)
8181
skeleton.calc_animation(a_clock, curious)
8282
a_clock +:= animation_step
83-
83+
8484
end
85-
85+
8686
method update_animation()
8787
a_clock +:= animation_step
8888
if a_clock > animation_track.get_max_key() then{
89-
a_clock := 0
90-
#CalcAnimation(_Skeletton)
91-
#CalcAttitude(_Skeletton,0)
92-
#SkinMesh(_Skeletton)
89+
a_clock := 0
90+
#CalcAnimation(_Skeletton)
91+
#CalcAttitude(_Skeletton,0)
92+
#SkinMesh(_Skeletton)
9393
}
94-
end
95-
94+
end
95+
9696
initially
9797
init()
9898
end

uni/3d/animationset.icn

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@ class AnimationSet(
2323
method get_label()
2424
return label
2525
end
26-
26+
2727
method is_name(nam)
2828
if label==name then return self
2929
end
30-
31-
method addAnimation(anim)
30+
31+
method addAnimation(anim)
3232
lsAnimation[anim.boneName]:=anim
3333
end
34-
35-
method get_animation_for_bone(bname)
36-
if member(lsAnimation, bname) then return lsAnimation[bname]
34+
35+
method get_animation_for_bone(bname)
36+
if member(lsAnimation, bname) then return lsAnimation[bname]
3737
end
38-
38+
3939
method get_max_key()
4040
return maxKey
4141
end
4242

43-
43+
4444
initially
4545
init()
4646
end

uni/3d/basicobject3d.icn

+48-48
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,46 @@ class BasicObject3D(
1515
label, # string
1616
loc, # Vector3
1717
orientation_angles, # Vector3 , Orientation in the 3D space
18-
# which are the angles around x, y, z axises
18+
# which are the angles around x, y, z axises
1919
scalexyz,
20-
color,
20+
color,
2121
radius, # aproximation of the bounding sphere radius
22-
23-
reference, # Vector3 a refrence point in the 3D space
24-
25-
bb_max, # max vector and min vector four bounding box calcs
26-
bb_min, #
27-
28-
visible_section, # Unicon WSection Record
29-
Txyz, # Unicon Translation Record
30-
Rx, #
22+
23+
reference, # Vector3 a refrence point in the 3D space
24+
25+
bb_max, # max vector and min vector four bounding box calcs
26+
bb_min, #
27+
28+
visible_section, # Unicon WSection Record
29+
Txyz, # Unicon Translation Record
30+
Rx, #
3131
Ry, # Unicon Rotation Records
32-
Rz, #
33-
32+
Rz, #
33+
3434
Sxyz,
35-
36-
37-
38-
render_func # rendering function if supplied
35+
36+
37+
38+
render_func # rendering function if supplied
3939
)
4040

4141
# render Template for all 3D objects
42-
method render()
42+
method render()
4343
visible_section := WSection( label )
44-
PushMatrix()
44+
PushMatrix()
4545
Txyz:=Translate (loc.x, loc.y, loc.z)
4646
Sxyz:=Scale(scalexyz.x, scalexyz.y, scalexyz.z)
4747
Rx:=Rotate(orientation_angles.x, 1.0, 0.0, 0.0)
4848
Ry:=Rotate(orientation_angles.y, 0.0, 1.0, 0.0)
4949
Rz:=Rotate(orientation_angles.z, 0.0, 0.0, 1.0)
50-
50+
5151
render_details() # this is the real render
52-
52+
5353

5454
PopMatrix()
5555
WSection()
5656
end
57-
57+
5858
# every object will override this method to customize
5959
# its look in the way it likes
6060
method render_details()
@@ -65,7 +65,7 @@ class BasicObject3D(
6565
method set_render_func(new_render)
6666
render_func := new_render
6767
end
68-
68+
6969
method refreshLoc()
7070
if /Txyz then fail
7171
Txyz.x:=loc.x
@@ -79,40 +79,40 @@ class BasicObject3D(
7979
Sxyz.y:=scalexyz.y
8080
Sxyz.z:=scalexyz.z
8181
end
82-
82+
8383
method refreshRot()
8484
if /Rx then fail
8585
Rx.angle := orientation_angles.x
8686
Ry.angle := orientation_angles.y
8787
Rz.angle := orientation_angles.z
8888
end
89-
89+
9090
method set_location (v)
9191
loc.set (v)
9292
refreshLoc()
9393
end
9494

9595
method set_locationxyz (x, y, z)
9696
loc.setxyz (x, y, z)
97-
refreshLoc()
97+
refreshLoc()
9898
end
99-
99+
100100
#
101101
# param count: 1(vector) OR 3(reals)
102102
#
103103
method move(dx, dy, dz)
104104
if numeric(dx) then
105105
loc.addxyz(dx, dy, dz)
106106
else
107-
loc.add(dx)
107+
loc.add(dx)
108108
refreshLoc()
109109
end
110-
110+
111111
method set_orientation(v)
112112
orientation_angles.set(v)
113113
refreshRot()
114114
end
115-
115+
116116
method set_orientationxyz(x, y, z)
117117
orientation_angles.setxyz(x, y, z)
118118
refreshRot()
@@ -125,7 +125,7 @@ class BasicObject3D(
125125
method set_referencexyz(x, y, z)
126126
reference.setxyz(x, y, z)
127127
end
128-
128+
129129
method rotate(rx, ry, rz)
130130
if numeric(rx) then
131131
orientation_angles.addxyz(rx, ry, rz)
@@ -137,49 +137,49 @@ class BasicObject3D(
137137
method show()
138138
visible_section.skip:=0
139139
end
140-
140+
141141
method hide()
142142
visible_section.skip:=1
143143
end
144-
144+
145145
method is_hidden()
146146
return visible_section.skip=1
147147
end
148-
148+
149149
method calc_bounding_box()
150150
end
151151

152-
method is_colliding( another_object )
153-
if loc.distance_to( another_object.loc ) <
152+
method is_colliding( another_object )
153+
if loc.distance_to( another_object.loc ) <
154154
radius + another_object.radius then return
155155
end
156-
156+
157157
method set_size_to(val)
158158
local d, dx, dy, dz, mesh, tx, ty, tz
159-
159+
160160
calc_bounding_box()
161-
161+
162162
/val := 1.0
163-
163+
164164
dx := bb_max.x - bb_min.x
165165
dy := bb_max.y - bb_min.y
166166
dz := bb_max.z - bb_min.z
167-
167+
168168
tx := -dx / 2.0 - bb_min.x
169169
ty := -bb_min.y
170170
tz := -dz / 2.0 - bb_min.z
171-
171+
172172

173173
if dx>dy & dx>dz then
174-
d:=dx
174+
d:=dx
175175
else if dy>dz then
176-
d:=dy
176+
d:=dy
177177
else
178-
d:=dz
178+
d:=dz
179179

180-
scalexyz.x := scalexyz.y := scalexyz.z := real(val) / d
180+
scalexyz.x := scalexyz.y := scalexyz.z := real(val) / d
181181
refreshScale()
182-
182+
183183
end
184184

185185
initially(myname )
@@ -190,4 +190,4 @@ class BasicObject3D(
190190
radius := 1.0
191191
bb_min := Vector3(-1,-1,-1)
192192
bb_max := Vector3( 1, 1, 1)
193-
end
193+
end

0 commit comments

Comments
 (0)