diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4e435b2 --- /dev/null +++ b/Makefile @@ -0,0 +1,70 @@ +# $Id: Makefile,v 1.8 2002/07/22 06:11:25 msell Exp $ +# +# +# $Log: Makefile,v $ +# Revision 1.8 2002/07/22 06:11:25 msell +# end.cpp +# +# Revision 1.7 2002/07/21 20:35:25 msell +# -D_GNU_SOURCE pois +# +# Revision 1.6 2002/07/21 20:33:27 msell +# -g pois +# +# Revision 1.5 2002/07/21 15:16:13 msell +# -Wall pois +# +# Revision 1.4 2002/07/21 15:12:59 msell +# test +# +# Revision 1.3 2002/07/21 15:12:16 msell +# Äänet enabloitu :) +# +# Revision 1.2 2002/07/19 19:48:06 msell +# Makefile +# +# Revision 1.1 2002/07/19 19:46:07 msell +# Makefile +# +# +# +# $Date: 2002/07/22 06:11:25 $ + +FMOD = yes + +GFXFLAGS = `sdl-config --cflags` +GFXLIBS = `sdl-config --libs` -lGL -lGLU -lSDL_image + +ifeq ($(FMOD), yes) + SNDFLAGS = -DUSEFMOD=1 + SNDLIBS = -lfmod-3.5 +endif + +CC = c++ +CFLAGS = -I. -O3 $(GFXFLAGS) $(SNDFLAGS) -pg -s +LIBS = $(GFXLIBS) $(SNDLIBS) + + +SRC = 3dutils.cpp appearance.cpp audio.cpp camera.cpp collision.cpp \ + fight.cpp font.cpp glapi.cpp graphics.cpp legoblocks.cpp \ + legoman.cpp light.cpp main.cpp material.cpp menu.cpp mesh.cpp \ + object.cpp objectfactory.cpp particle.cpp run.cpp shape.cpp \ + sphere.cpp texture.cpp utils.cpp vector.cpp world.cpp end.cpp + + +OBJ = $(SRC:%.cpp=src/%.o) + +all: blockofighter + +clean: + rm -f $(OBJ) gmon.out + +distclean: clean + rm -f blockofighter + +blockofighter: $(OBJ) + $(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c -o $@ $< + diff --git a/data/blockolegscaled.asc b/data/blockolegscaled.asc new file mode 100644 index 0000000..5e50579 --- /dev/null +++ b/data/blockolegscaled.asc @@ -0,0 +1,160 @@ +Ambient light color: Red=0.0000 Green=0.0000 Blue=0.0000 + +Named object: "jalka1" +Tri-mesh, Vertices: 32 Faces: 60 +Mapped +Vertex list: +Vertex 0: X:-3.2904 Y:-6.3682 Z:-2.4075 U:0.6909 V:0.1580 +Vertex 1: X:-3.2904 Y:1.0225 Z:-2.8320 U:0.7380 V:0.6200 +Vertex 2: X:-3.2904 Y:1.5878 Z:-3.2093 U:0.7798 V:0.6553 +Vertex 3: X:-3.2904 Y:2.2435 Z:-3.4923 U:0.8112 V:0.6963 +Vertex 4: X:-3.2904 Y:3.2339 Z:-3.6792 U:0.8319 V:0.7583 +Vertex 5: X:-3.2904 Y:5.0261 Z:-3.2750 U:0.7871 V:0.8703 +Vertex 6: X:-3.2904 Y:5.8825 Z:-2.7160 U:0.7251 V:0.9238 +Vertex 7: X:-3.2904 Y:6.3874 Z:-2.1454 U:0.6618 V:0.9554 +Vertex 8: X:-3.2904 Y:6.8429 Z:-1.2758 U:0.5654 V:0.9839 +Vertex 9: X:-3.2904 Y:7.0927 Z:-0.1927 U:0.4453 V:0.9995 +Vertex 10: X:-3.2904 Y:6.7671 Z:1.7856 U:0.2259 V:0.9791 +Vertex 11: X:-3.2904 Y:6.1074 Z:2.6333 U:0.1319 V:0.9379 +Vertex 12: X:-3.2904 Y:5.0313 Z:3.4472 U:0.0416 V:0.8706 +Vertex 13: X:-3.2904 Y:-8.8867 Z:3.8179 U:0.0005 V:0.0005 +Vertex 14: X:-3.2904 Y:-8.8867 Z:-5.1901 U:0.9995 V:0.0005 +Vertex 15: X:-3.2904 Y:-6.3871 Z:-5.1901 U:0.9995 V:0.1568 +Vertex 16: X:3.4077 Y:-6.3682 Z:-2.4075 U:0.6909 V:0.1580 +Vertex 17: X:3.4077 Y:1.0225 Z:-2.8320 U:0.7380 V:0.6200 +Vertex 18: X:3.4077 Y:1.5878 Z:-3.2093 U:0.7798 V:0.6553 +Vertex 19: X:3.4077 Y:2.2435 Z:-3.4923 U:0.8112 V:0.6963 +Vertex 20: X:3.4077 Y:3.2339 Z:-3.6792 U:0.8319 V:0.7583 +Vertex 21: X:3.4077 Y:5.0261 Z:-3.2750 U:0.7871 V:0.8703 +Vertex 22: X:3.4077 Y:5.8825 Z:-2.7160 U:0.7251 V:0.9238 +Vertex 23: X:3.4077 Y:6.3874 Z:-2.1454 U:0.6618 V:0.9554 +Vertex 24: X:3.4077 Y:6.8429 Z:-1.2758 U:0.5654 V:0.9839 +Vertex 25: X:3.4077 Y:7.0927 Z:-0.1927 U:0.4453 V:0.9995 +Vertex 26: X:3.4077 Y:6.7671 Z:1.7856 U:0.2259 V:0.9791 +Vertex 27: X:3.4077 Y:6.1074 Z:2.6333 U:0.1319 V:0.9379 +Vertex 28: X:3.4077 Y:5.0313 Z:3.4472 U:0.0416 V:0.8706 +Vertex 29: X:3.4077 Y:-8.8867 Z:3.8179 U:0.0005 V:0.0005 +Vertex 30: X:3.4077 Y:-8.8867 Z:-5.1901 U:0.9995 V:0.0005 +Vertex 31: X:3.4077 Y:-6.3871 Z:-5.1901 U:0.9995 V:0.1568 +Face list: +Face 0: A:0 B:1 C:17 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 1 +Face 1: A:0 B:17 C:16 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 1 +Face 2: A:1 B:2 C:18 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 3: A:1 B:18 C:17 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 4: A:2 B:3 C:19 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 5: A:2 B:19 C:18 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 6: A:3 B:4 C:20 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 7: A:3 B:20 C:19 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 8: A:4 B:5 C:21 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 9: A:4 B:21 C:20 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 10: A:5 B:6 C:22 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 11: A:5 B:22 C:21 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 12: A:6 B:7 C:23 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 13: A:6 B:23 C:22 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 14: A:7 B:8 C:24 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 15: A:7 B:24 C:23 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 16: A:8 B:9 C:25 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 17: A:8 B:25 C:24 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 18: A:9 B:10 C:26 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 19: A:9 B:26 C:25 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 20: A:10 B:11 C:27 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 21: A:10 B:27 C:26 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 22: A:11 B:12 C:28 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 23: A:11 B:28 C:27 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 24: A:12 B:13 C:29 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 2 +Face 25: A:12 B:29 C:28 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 2 +Face 26: A:13 B:14 C:30 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 3 +Face 27: A:13 B:30 C:29 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 3 +Face 28: A:14 B:15 C:31 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 2 +Face 29: A:14 B:31 C:30 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 2 +Face 30: A:15 B:0 C:16 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 3 +Face 31: A:15 B:16 C:31 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 3 +Face 32: A:13 B:15 C:14 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 5 +Face 33: A:13 B:0 C:15 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 34: A:12 B:0 C:13 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 35: A:12 B:1 C:0 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 36: A:11 B:1 C:12 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 37: A:11 B:2 C:1 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 38: A:11 B:3 C:2 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 39: A:10 B:3 C:11 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 40: A:9 B:3 C:10 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 41: A:8 B:3 C:9 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 42: A:7 B:3 C:8 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 43: A:6 B:3 C:7 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 44: A:5 B:3 C:6 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 45: A:4 B:3 C:5 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 46: A:29 B:30 C:31 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 47: A:29 B:31 C:16 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 48: A:28 B:29 C:16 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 49: A:28 B:16 C:17 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 50: A:27 B:28 C:17 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 51: A:27 B:17 C:18 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 52: A:27 B:18 C:19 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 53: A:26 B:27 C:19 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 54: A:25 B:26 C:19 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 55: A:24 B:25 C:19 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 56: A:23 B:24 C:19 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 57: A:22 B:23 C:19 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 58: A:21 B:22 C:19 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 59: A:20 B:21 C:19 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 + diff --git a/data/blockotorsoscaled.asc b/data/blockotorsoscaled.asc new file mode 100644 index 0000000..be3465e --- /dev/null +++ b/data/blockotorsoscaled.asc @@ -0,0 +1,40 @@ +Ambient light color: Red=0.0000 Green=0.0000 Blue=0.0000 + +Named object: "BlockoTorso" +Tri-mesh, Vertices: 8 Faces: 12 +Mapped +Vertex list: +Vertex 0: X:7.9304 Y:-5.7145 Z:-3.9370 U:0.0000 V:0.0000 +Vertex 1: X:5.9145 Y:8.4213 Z:-4.0770 U:0.2629 V:0.0000 +Vertex 2: X:-6.6049 Y:8.4214 Z:-4.0770 U:0.4666 V:0.0000 +Vertex 3: X:-8.5263 Y:-5.8986 Z:-3.9354 U:0.7323 V:0.0000 +Vertex 4: X:7.9304 Y:-5.6399 Z:4.6084 U:1.0000 V:0.0000 +Vertex 5: X:5.9145 Y:8.4959 Z:4.4684 U:0.0000 V:1.0000 +Vertex 6: X:-6.6049 Y:8.4960 Z:4.4684 U:0.2629 V:1.0000 +Vertex 7: X:-8.5263 Y:-5.8240 Z:4.6100 U:0.4666 V:1.0000 +Face list: +Face 0: A:0 B:1 C:5 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 1 +Face 1: A:0 B:5 C:4 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 1 +Face 2: A:1 B:2 C:6 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 3 +Face 3: A:1 B:6 C:5 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 3 +Face 4: A:2 B:3 C:7 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 2 +Face 5: A:2 B:7 C:6 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 2 +Face 6: A:3 B:0 C:4 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 3 +Face 7: A:3 B:4 C:7 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 3 +Face 8: A:2 B:0 C:3 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 5 +Face 9: A:2 B:1 C:0 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 10: A:6 B:7 C:4 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 11: A:6 B:4 C:5 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 5 + diff --git a/data/blockowaistscaled.asc b/data/blockowaistscaled.asc new file mode 100644 index 0000000..8b05601 --- /dev/null +++ b/data/blockowaistscaled.asc @@ -0,0 +1,402 @@ +Ambient light color: Red=0.0000 Green=0.0000 Blue=0.0000 + +Named object: "BlockoWaist" +Tri-mesh, Vertices: 82 Faces: 156 +Mapped +Vertex list: +Vertex 0: X:-7.8379 Y:-0.6276 Z:3.4615 U:0.0000 V:0.0000 +Vertex 1: X:-7.8379 Y:-0.0029 Z:2.8671 U:0.0000 V:0.0000 +Vertex 2: X:-7.8379 Y:0.4064 Z:2.3468 U:0.0000 V:0.0000 +Vertex 3: X:-7.8379 Y:0.6286 Z:1.6786 U:0.0000 V:0.0000 +Vertex 4: X:-7.8379 Y:0.7771 Z:0.9489 U:0.0000 V:0.0000 +Vertex 5: X:-7.8379 Y:0.7658 Z:-0.3442 U:0.0000 V:0.0000 +Vertex 6: X:-7.8379 Y:0.4505 Z:-1.4278 U:0.0000 V:0.0000 +Vertex 7: X:-7.8379 Y:0.0895 Z:-2.0971 U:0.0000 V:0.0000 +Vertex 8: X:-7.8379 Y:-0.6214 Z:-2.8582 U:0.0000 V:0.0000 +Vertex 9: X:-7.8853 Y:-0.6418 Z:-4.1596 U:0.0000 V:0.0000 +Vertex 10: X:-7.8853 Y:1.1771 Z:-4.1758 U:0.0000 V:0.0000 +Vertex 11: X:-7.8379 Y:1.3024 Z:4.2549 U:0.0000 V:0.0000 +Vertex 12: X:-7.8379 Y:-0.6223 Z:4.2717 U:0.0000 V:0.0000 +Vertex 13: X:7.8521 Y:-0.6276 Z:3.4615 U:0.0000 V:0.0000 +Vertex 14: X:7.8521 Y:-0.0029 Z:2.8671 U:0.0000 V:0.0000 +Vertex 15: X:7.8521 Y:0.4064 Z:2.3468 U:0.0000 V:0.0000 +Vertex 16: X:7.8521 Y:0.6286 Z:1.6786 U:0.0000 V:0.0000 +Vertex 17: X:7.8521 Y:0.7771 Z:0.9489 U:0.0000 V:0.0000 +Vertex 18: X:7.8521 Y:0.7658 Z:-0.3443 U:0.0000 V:0.0000 +Vertex 19: X:7.8521 Y:0.4505 Z:-1.4278 U:0.0000 V:0.0000 +Vertex 20: X:7.8521 Y:0.0895 Z:-2.0971 U:0.0000 V:0.0000 +Vertex 21: X:7.8521 Y:-0.6214 Z:-2.8582 U:0.0000 V:0.0000 +Vertex 22: X:7.8047 Y:-0.6418 Z:-4.1596 U:0.0000 V:0.0000 +Vertex 23: X:7.8047 Y:1.1771 Z:-4.1758 U:0.0000 V:0.0000 +Vertex 24: X:7.8521 Y:1.3024 Z:4.2549 U:0.0000 V:0.0000 +Vertex 25: X:7.8521 Y:-0.6223 Z:4.2717 U:0.0000 V:0.0000 +Vertex 26: X:-0.6238 Y:-3.2036 Z:-3.7235 U:0.9995 V:0.5000 +Vertex 27: X:-0.6238 Y:-2.2939 Z:-3.6266 U:0.9863 V:0.6145 +Vertex 28: X:-0.6238 Y:-1.4568 Z:-3.3352 U:0.9487 V:0.7196 +Vertex 29: X:-0.6238 Y:-0.7162 Z:-2.8732 U:0.8897 V:0.8123 +Vertex 30: X:-0.6238 Y:-0.0965 Z:-2.2642 U:0.8123 V:0.8897 +Vertex 31: X:-0.6238 Y:0.3784 Z:-1.5318 U:0.7196 V:0.9487 +Vertex 32: X:-0.6237 Y:0.6843 Z:-0.6999 U:0.6145 V:0.9863 +Vertex 33: X:-0.6237 Y:0.7971 Z:0.2079 U:0.5000 V:0.9995 +Vertex 34: X:-0.6237 Y:0.7001 Z:1.1176 U:0.3855 V:0.9863 +Vertex 35: X:-0.6237 Y:0.4088 Z:1.9547 U:0.2804 V:0.9487 +Vertex 36: X:-0.6237 Y:-0.0532 Z:2.6952 U:0.1877 V:0.8897 +Vertex 37: X:-0.6237 Y:-0.6622 Z:3.3150 U:0.1103 V:0.8123 +Vertex 38: X:-0.6237 Y:-1.3946 Z:3.7899 U:0.0513 V:0.7196 +Vertex 39: X:-0.6237 Y:-2.2265 Z:4.0957 U:0.0137 V:0.6145 +Vertex 40: X:-0.6237 Y:-3.1343 Z:4.2085 U:0.0005 V:0.5000 +Vertex 41: X:-0.6237 Y:-4.0440 Z:4.1116 U:0.0137 V:0.3855 +Vertex 42: X:-0.6237 Y:-4.8811 Z:3.8203 U:0.0513 V:0.2804 +Vertex 43: X:-0.6237 Y:-5.6216 Z:3.3583 U:0.1103 V:0.1877 +Vertex 44: X:-0.6237 Y:-6.2414 Z:2.7492 U:0.1877 V:0.1103 +Vertex 45: X:-0.6237 Y:-6.7163 Z:2.0169 U:0.2804 V:0.0513 +Vertex 46: X:-0.6238 Y:-7.0222 Z:1.1850 U:0.3855 V:0.0137 +Vertex 47: X:-0.6238 Y:-7.1349 Z:0.2771 U:0.5000 V:0.0005 +Vertex 48: X:-0.6238 Y:-7.0380 Z:-0.6325 U:0.6145 V:0.0137 +Vertex 49: X:-0.6238 Y:-6.7467 Z:-1.4697 U:0.7196 V:0.0513 +Vertex 50: X:-0.6238 Y:-6.2847 Z:-2.2102 U:0.8123 V:0.1103 +Vertex 51: X:-0.6238 Y:-5.6756 Z:-2.8299 U:0.8897 V:0.1877 +Vertex 52: X:-0.6238 Y:-4.9433 Z:-3.3048 U:0.9487 V:0.2804 +Vertex 53: X:-0.6238 Y:-4.1114 Z:-3.6107 U:0.9863 V:0.3855 +Vertex 54: X:0.4257 Y:-3.2036 Z:-3.7235 U:0.9995 V:0.5000 +Vertex 55: X:0.4257 Y:-2.2939 Z:-3.6266 U:0.9863 V:0.6145 +Vertex 56: X:0.4257 Y:-1.4568 Z:-3.3352 U:0.9487 V:0.7196 +Vertex 57: X:0.4257 Y:-0.7162 Z:-2.8732 U:0.8897 V:0.8123 +Vertex 58: X:0.4257 Y:-0.0965 Z:-2.2642 U:0.8123 V:0.8897 +Vertex 59: X:0.4257 Y:0.3784 Z:-1.5318 U:0.7196 V:0.9487 +Vertex 60: X:0.4257 Y:0.6843 Z:-0.6999 U:0.6145 V:0.9863 +Vertex 61: X:0.4257 Y:0.7971 Z:0.2079 U:0.5000 V:0.9995 +Vertex 62: X:0.4257 Y:0.7001 Z:1.1176 U:0.3855 V:0.9863 +Vertex 63: X:0.4257 Y:0.4088 Z:1.9547 U:0.2804 V:0.9487 +Vertex 64: X:0.4257 Y:-0.0532 Z:2.6952 U:0.1877 V:0.8897 +Vertex 65: X:0.4257 Y:-0.6622 Z:3.3150 U:0.1103 V:0.8123 +Vertex 66: X:0.4257 Y:-1.3946 Z:3.7899 U:0.0513 V:0.7196 +Vertex 67: X:0.4257 Y:-2.2265 Z:4.0957 U:0.0137 V:0.6145 +Vertex 68: X:0.4257 Y:-3.1343 Z:4.2085 U:0.0005 V:0.5000 +Vertex 69: X:0.4257 Y:-4.0440 Z:4.1116 U:0.0137 V:0.3855 +Vertex 70: X:0.4257 Y:-4.8811 Z:3.8203 U:0.0513 V:0.2804 +Vertex 71: X:0.4257 Y:-5.6216 Z:3.3583 U:0.1103 V:0.1877 +Vertex 72: X:0.4257 Y:-6.2414 Z:2.7492 U:0.1877 V:0.1103 +Vertex 73: X:0.4257 Y:-6.7163 Z:2.0169 U:0.2804 V:0.0513 +Vertex 74: X:0.4257 Y:-7.0222 Z:1.1850 U:0.3855 V:0.0137 +Vertex 75: X:0.4257 Y:-7.1349 Z:0.2771 U:0.5000 V:0.0005 +Vertex 76: X:0.4257 Y:-7.0380 Z:-0.6325 U:0.6145 V:0.0137 +Vertex 77: X:0.4257 Y:-6.7467 Z:-1.4697 U:0.7196 V:0.0513 +Vertex 78: X:0.4257 Y:-6.2847 Z:-2.2102 U:0.8123 V:0.1103 +Vertex 79: X:0.4257 Y:-5.6756 Z:-2.8299 U:0.8897 V:0.1877 +Vertex 80: X:0.4257 Y:-4.9433 Z:-3.3048 U:0.9487 V:0.2804 +Vertex 81: X:0.4257 Y:-4.1114 Z:-3.6107 U:0.9863 V:0.3855 +Face list: +Face 0: A:0 B:1 C:14 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 1: A:0 B:14 C:13 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 2: A:1 B:2 C:15 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 3: A:1 B:15 C:14 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 4: A:2 B:3 C:16 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 5: A:2 B:16 C:15 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 6: A:3 B:4 C:17 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 7: A:3 B:17 C:16 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 8: A:4 B:5 C:18 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 9: A:4 B:18 C:17 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 10: A:5 B:6 C:19 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 11: A:5 B:19 C:18 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 12: A:6 B:7 C:20 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 13: A:6 B:20 C:19 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 14: A:7 B:8 C:21 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 15: A:7 B:21 C:20 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 16: A:8 B:9 C:22 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 17: A:8 B:22 C:21 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 18: A:9 B:10 C:23 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 3 +Face 19: A:9 B:23 C:22 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 3 +Face 20: A:10 B:11 C:24 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 21: A:10 B:24 C:23 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 22: A:11 B:12 C:25 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 3 +Face 23: A:11 B:25 C:24 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 3 +Face 24: A:12 B:0 C:13 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 25: A:12 B:13 C:25 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 26: A:8 B:10 C:9 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 5 +Face 27: A:7 B:10 C:8 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 28: A:11 B:0 C:12 AB:0 BC:1 CA:1 Nosmooth +Smoothing: 5 +Face 29: A:11 B:1 C:0 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 30: A:11 B:2 C:1 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 31: A:6 B:10 C:7 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 32: A:11 B:3 C:2 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 33: A:5 B:10 C:6 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 34: A:5 B:11 C:10 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 35: A:4 B:11 C:5 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 36: A:4 B:3 C:11 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 37: A:21 B:22 C:23 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 38: A:20 B:21 C:23 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 39: A:24 B:25 C:13 AB:1 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 40: A:24 B:13 C:14 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 41: A:24 B:14 C:15 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 42: A:19 B:20 C:23 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 43: A:24 B:15 C:16 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 44: A:18 B:19 C:23 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 45: A:18 B:23 C:24 AB:0 BC:1 CA:0 Nosmooth +Smoothing: 5 +Face 46: A:17 B:18 C:24 AB:1 BC:0 CA:0 Nosmooth +Smoothing: 5 +Face 47: A:17 B:24 C:16 AB:0 BC:0 CA:1 Nosmooth +Smoothing: 5 +Face 48: A:26 B:27 C:55 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 49: A:26 B:55 C:54 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 50: A:27 B:28 C:56 AB:1 BC:1 CA:0 +Smoothing: 1, 2 +Face 51: A:27 B:56 C:55 AB:0 BC:1 CA:1 +Smoothing: 1, 2 +Face 52: A:28 B:29 C:57 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 53: A:28 B:57 C:56 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 54: A:29 B:30 C:58 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 55: A:29 B:58 C:57 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 56: A:30 B:31 C:59 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 57: A:30 B:59 C:58 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 58: A:31 B:32 C:60 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 59: A:31 B:60 C:59 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 60: A:32 B:33 C:61 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 61: A:32 B:61 C:60 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 62: A:33 B:34 C:62 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 63: A:33 B:62 C:61 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 64: A:34 B:35 C:63 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 65: A:34 B:63 C:62 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 66: A:35 B:36 C:64 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 67: A:35 B:64 C:63 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 68: A:36 B:37 C:65 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 69: A:36 B:65 C:64 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 70: A:37 B:38 C:66 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 71: A:37 B:66 C:65 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 72: A:38 B:39 C:67 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 73: A:38 B:67 C:66 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 74: A:39 B:40 C:68 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 75: A:39 B:68 C:67 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 76: A:40 B:41 C:69 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 77: A:40 B:69 C:68 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 78: A:41 B:42 C:70 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 79: A:41 B:70 C:69 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 80: A:42 B:43 C:71 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 81: A:42 B:71 C:70 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 82: A:43 B:44 C:72 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 83: A:43 B:72 C:71 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 84: A:44 B:45 C:73 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 85: A:44 B:73 C:72 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 86: A:45 B:46 C:74 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 87: A:45 B:74 C:73 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 88: A:46 B:47 C:75 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 89: A:46 B:75 C:74 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 90: A:47 B:48 C:76 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 91: A:47 B:76 C:75 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 92: A:48 B:49 C:77 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 93: A:48 B:77 C:76 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 94: A:49 B:50 C:78 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 95: A:49 B:78 C:77 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 96: A:50 B:51 C:79 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 97: A:50 B:79 C:78 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 98: A:51 B:52 C:80 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 99: A:51 B:80 C:79 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 100: A:52 B:53 C:81 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 101: A:52 B:81 C:80 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 102: A:53 B:26 C:54 AB:1 BC:1 CA:0 +Smoothing: 1, 2 +Face 103: A:53 B:54 C:81 AB:0 BC:1 CA:1 +Smoothing: 1, 2 +Face 104: A:39 B:41 C:40 AB:0 BC:1 CA:1 +Smoothing: 5 +Face 105: A:39 B:42 C:41 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 106: A:38 B:42 C:39 AB:0 BC:0 CA:1 +Smoothing: 5 +Face 107: A:38 B:43 C:42 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 108: A:37 B:43 C:38 AB:0 BC:0 CA:1 +Smoothing: 5 +Face 109: A:36 B:43 C:37 AB:0 BC:0 CA:1 +Smoothing: 5 +Face 110: A:36 B:44 C:43 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 111: A:36 B:45 C:44 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 112: A:36 B:46 C:45 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 113: A:36 B:47 C:46 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 114: A:36 B:48 C:47 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 115: A:36 B:49 C:48 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 116: A:36 B:50 C:49 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 117: A:36 B:51 C:50 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 118: A:36 B:52 C:51 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 119: A:36 B:53 C:52 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 120: A:36 B:26 C:53 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 121: A:36 B:27 C:26 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 122: A:36 B:28 C:27 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 123: A:36 B:29 C:28 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 124: A:36 B:30 C:29 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 125: A:36 B:31 C:30 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 126: A:36 B:32 C:31 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 127: A:36 B:33 C:32 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 128: A:36 B:34 C:33 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 129: A:36 B:35 C:34 AB:1 BC:1 CA:0 +Smoothing: 5 +Face 130: A:67 B:68 C:69 AB:1 BC:1 CA:0 +Smoothing: 5 +Face 131: A:67 B:69 C:70 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 132: A:66 B:67 C:70 AB:1 BC:0 CA:0 +Smoothing: 5 +Face 133: A:66 B:70 C:71 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 134: A:65 B:66 C:71 AB:1 BC:0 CA:0 +Smoothing: 5 +Face 135: A:64 B:65 C:71 AB:1 BC:0 CA:0 +Smoothing: 5 +Face 136: A:64 B:71 C:72 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 137: A:64 B:72 C:73 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 138: A:64 B:73 C:74 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 139: A:64 B:74 C:75 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 140: A:64 B:75 C:76 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 141: A:64 B:76 C:77 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 142: A:64 B:77 C:78 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 143: A:64 B:78 C:79 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 144: A:64 B:79 C:80 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 145: A:64 B:80 C:81 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 146: A:64 B:81 C:54 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 147: A:64 B:54 C:55 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 148: A:64 B:55 C:56 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 149: A:64 B:56 C:57 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 150: A:64 B:57 C:58 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 151: A:64 B:58 C:59 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 152: A:64 B:59 C:60 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 153: A:64 B:60 C:61 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 154: A:64 B:61 C:62 AB:0 BC:1 CA:0 +Smoothing: 5 +Face 155: A:64 B:62 C:63 AB:0 BC:1 CA:1 +Smoothing: 5 + diff --git a/data/damagehand.png b/data/damagehand.png new file mode 100644 index 0000000..eae1b89 Binary files /dev/null and b/data/damagehand.png differ diff --git a/data/damagehead.png b/data/damagehead.png new file mode 100644 index 0000000..8cfae8a Binary files /dev/null and b/data/damagehead.png differ diff --git a/data/damageleg.png b/data/damageleg.png new file mode 100644 index 0000000..24f83d6 Binary files /dev/null and b/data/damageleg.png differ diff --git a/data/damagetorso.png b/data/damagetorso.png new file mode 100644 index 0000000..0bc8c82 Binary files /dev/null and b/data/damagetorso.png differ diff --git a/data/fall1.wav b/data/fall1.wav new file mode 100644 index 0000000..41d1686 Binary files /dev/null and b/data/fall1.wav differ diff --git a/data/fall2.wav b/data/fall2.wav new file mode 100644 index 0000000..f5caef1 Binary files /dev/null and b/data/fall2.wav differ diff --git a/data/fight.mp3 b/data/fight.mp3 new file mode 100644 index 0000000..03f1cde Binary files /dev/null and b/data/fight.mp3 differ diff --git a/data/fight.wav b/data/fight.wav new file mode 100644 index 0000000..4331b51 Binary files /dev/null and b/data/fight.wav differ diff --git a/data/flare.png b/data/flare.png new file mode 100644 index 0000000..c7b98e0 Binary files /dev/null and b/data/flare.png differ diff --git a/data/font.png b/data/font.png new file mode 100644 index 0000000..9e44d0c Binary files /dev/null and b/data/font.png differ diff --git a/data/hit1.wav b/data/hit1.wav new file mode 100644 index 0000000..cb2b814 Binary files /dev/null and b/data/hit1.wav differ diff --git a/data/hitsoft1.wav b/data/hitsoft1.wav new file mode 100644 index 0000000..878e622 Binary files /dev/null and b/data/hitsoft1.wav differ diff --git a/data/hitsoft2.wav b/data/hitsoft2.wav new file mode 100644 index 0000000..581b4ea Binary files /dev/null and b/data/hitsoft2.wav differ diff --git a/data/jump.wav b/data/jump.wav new file mode 100644 index 0000000..524b8e2 Binary files /dev/null and b/data/jump.wav differ diff --git a/data/leftarm.asc b/data/leftarm.asc new file mode 100644 index 0000000..e89e97f --- /dev/null +++ b/data/leftarm.asc @@ -0,0 +1,810 @@ +Ambient light color: Red=0.0000 Green=0.0000 Blue=0.0000 + +Named object: "BlockoHandRight02" +Tri-mesh, Vertices: 162 Faces: 320 +Mapped +Vertex list: +Vertex 0: X:0.2585 Y:6.3832 Z:-0.3438 U:0.4367 V:0.6319 +Vertex 1: X:0.3128 Y:6.3802 Z:-0.2495 U:0.4227 V:0.6404 +Vertex 2: X:1.6655 Y:5.5338 Z:-1.9743 U:0.6480 V:0.9382 +Vertex 3: X:-0.2510 Y:4.5548 Z:-3.1671 U:0.8426 V:0.6169 +Vertex 4: X:1.8177 Y:4.3915 Z:-2.4432 U:0.7134 V:0.9940 +Vertex 5: X:0.3165 Y:4.6165 Z:2.7651 U:0.0020 V:0.6169 +Vertex 6: X:1.4639 Y:0.7845 Z:-2.3719 U:0.7134 V:0.9865 +Vertex 7: X:1.1262 Y:-0.3284 Z:-2.5700 U:0.7474 V:0.9453 +Vertex 8: X:1.5822 Y:-0.7933 Z:-0.3795 U:0.4344 V:0.9995 +Vertex 9: X:0.9876 Y:-1.3241 Z:2.5612 U:0.0303 V:0.8449 +Vertex 10: X:-0.4685 Y:-1.2753 Z:2.7491 U:0.0234 V:0.5682 +Vertex 11: X:-1.6705 Y:-2.0509 Z:-3.0829 U:0.8595 V:0.4596 +Vertex 12: X:-0.0539 Y:-2.7838 Z:-2.4606 U:0.7515 V:0.7633 +Vertex 13: X:-2.4832 Y:-4.1856 Z:-3.9799 U:0.9995 V:0.3588 +Vertex 14: X:-0.4936 Y:-5.3122 Z:-2.1315 U:0.7149 V:0.7172 +Vertex 15: X:-2.2695 Y:-6.1044 Z:0.0737 U:0.4303 V:0.3588 +Vertex 16: X:-4.2591 Y:-4.9778 Z:-1.7747 U:0.7149 V:0.0005 +Vertex 17: X:0.0050 Y:5.9558 Z:-1.9655 U:0.6684 V:0.6203 +Vertex 18: X:1.2246 Y:5.5653 Z:-2.2760 U:0.6962 V:0.8605 +Vertex 19: X:1.3421 Y:5.8427 Z:-1.5546 U:0.5930 V:0.8651 +Vertex 20: X:0.6572 Y:6.1631 Z:-0.3071 U:0.4265 V:0.7095 +Vertex 21: X:0.9318 Y:5.9054 Z:-0.3526 U:0.4296 V:0.7660 +Vertex 22: X:0.7058 Y:6.1715 Z:0.3133 U:0.3387 V:0.7074 +Vertex 23: X:-1.2196 Y:-2.9438 Z:1.9860 U:0.1430 V:0.4689 +Vertex 24: X:0.1904 Y:-2.1434 Z:2.3390 U:0.0734 V:0.7132 +Vertex 25: X:-0.3064 Y:-4.7882 Z:-1.7143 U:0.6530 V:0.7361 +Vertex 26: X:-0.0558 Y:-4.1725 Z:-1.3472 U:0.5972 V:0.7663 +Vertex 27: X:-0.2827 Y:-3.6185 Z:-2.3753 U:0.7438 V:0.7328 +Vertex 28: X:-0.4293 Y:-4.4613 Z:-2.2656 U:0.7316 V:0.7174 +Vertex 29: X:0.2897 Y:6.3734 Z:-0.3170 U:0.4325 V:0.6374 +Vertex 30: X:0.3150 Y:6.3813 Z:-0.1844 U:0.4136 V:0.6396 +Vertex 31: X:0.2399 Y:6.3884 Z:-0.1510 U:0.4099 V:0.6249 +Vertex 32: X:1.3569 Y:5.5632 Z:-1.7734 U:0.6239 V:0.8764 +Vertex 33: X:-1.0749 Y:6.0845 Z:-0.1106 U:0.4223 V:0.3831 +Vertex 34: X:-1.4056 Y:5.8122 Z:-1.2469 U:0.5867 V:0.3459 +Vertex 35: X:-0.8926 Y:5.7510 Z:-2.1281 U:0.7036 V:0.4586 +Vertex 36: X:1.2217 Y:5.6366 Z:1.5211 U:0.1630 V:0.7915 +Vertex 37: X:0.9888 Y:5.6627 Z:1.8816 U:0.1155 V:0.7410 +Vertex 38: X:0.3373 Y:5.9919 Z:1.5082 U:0.1762 V:0.6203 +Vertex 39: X:0.3134 Y:6.2131 Z:0.7688 U:0.2800 V:0.6252 +Vertex 40: X:-0.5127 Y:5.7923 Z:1.8421 U:0.1410 V:0.4586 +Vertex 41: X:-1.1836 Y:5.8363 Z:1.0731 U:0.2579 V:0.3459 +Vertex 42: X:0.7078 Y:4.4727 Z:-3.1217 U:0.8235 V:0.7969 +Vertex 43: X:1.3435 Y:4.4238 Z:-2.8412 U:0.7757 V:0.9118 +Vertex 44: X:1.8497 Y:4.9671 Z:-2.3710 U:0.7020 V:0.9891 +Vertex 45: X:1.8254 Y:5.2687 Z:-2.2388 U:0.6834 V:0.9772 +Vertex 46: X:-0.1522 Y:5.4235 Z:-2.8763 U:0.7992 V:0.6158 +Vertex 47: X:-0.1931 Y:5.1276 Z:-3.0614 U:0.8262 V:0.6164 +Vertex 48: X:-1.8058 Y:5.6206 Z:-0.0359 U:0.4223 V:0.2527 +Vertex 49: X:-1.9650 Y:5.3387 Z:-0.0177 U:0.4223 V:0.2273 +Vertex 50: X:-1.2857 Y:4.6544 Z:-2.6601 U:0.7852 V:0.4126 +Vertex 51: X:1.5142 Y:4.4211 Z:-2.1929 U:0.6823 V:0.9323 +Vertex 52: X:1.3278 Y:5.0448 Z:-0.4148 U:0.4343 V:0.8555 +Vertex 53: X:1.2671 Y:5.3462 Z:-0.4064 U:0.4335 V:0.8390 +Vertex 54: X:1.4416 Y:4.5068 Z:2.0474 U:0.0878 V:0.8421 +Vertex 55: X:1.1412 Y:4.5404 Z:2.5124 U:0.0265 V:0.7770 +Vertex 56: X:0.3522 Y:5.1868 Z:2.6385 U:0.0184 V:0.6164 +Vertex 57: X:0.3567 Y:5.4787 Z:2.4430 U:0.0454 V:0.6158 +Vertex 58: X:-0.7958 Y:4.7076 Z:2.4615 U:0.0594 V:0.4126 +Vertex 59: X:1.1795 Y:0.8124 Z:-2.1234 U:0.6823 V:0.9284 +Vertex 60: X:0.9968 Y:0.8378 Z:-1.5546 U:0.6049 V:0.8837 +Vertex 61: X:1.1640 Y:0.8790 Z:1.3618 U:0.1931 V:0.8626 +Vertex 62: X:1.1274 Y:0.8962 Z:2.1150 U:0.0878 V:0.8421 +Vertex 63: X:0.8269 Y:0.9299 Z:2.5799 U:0.0265 V:0.7770 +Vertex 64: X:1.3006 Y:0.0496 Z:-2.5167 U:0.7371 V:0.9707 +Vertex 65: X:1.3814 Y:0.2785 Z:-2.4293 U:0.7234 V:0.9805 +Vertex 66: X:-0.7605 Y:0.3367 Z:-3.1118 U:0.8479 V:0.5907 +Vertex 67: X:-2.5204 Y:0.4998 Z:0.0986 U:0.4205 V:0.2017 +Vertex 68: X:1.2929 Y:-0.3897 Z:-2.2258 U:0.6969 V:0.9714 +Vertex 69: X:1.4485 Y:-0.5212 Z:-1.5921 U:0.6061 V:0.9915 +Vertex 70: X:1.5602 Y:-1.0751 Z:0.9443 U:0.2492 V:0.9766 +Vertex 71: X:1.3267 Y:-1.2311 Z:1.8558 U:0.1246 V:0.9193 +Vertex 72: X:1.2298 Y:-0.6186 Z:2.3488 U:0.0558 V:0.8823 +Vertex 73: X:1.1902 Y:0.0546 Z:1.8936 U:0.1193 V:0.8717 +Vertex 74: X:-0.2475 Y:-0.5444 Z:2.8769 U:0.0014 V:0.5952 +Vertex 75: X:-0.1139 Y:0.1569 Z:2.8631 U:0.0005 V:0.6088 +Vertex 76: X:-1.5713 Y:-1.0893 Z:2.4575 U:0.0789 V:0.3639 +Vertex 77: X:-0.8311 Y:-2.3215 Z:-3.0474 U:0.8437 V:0.6205 +Vertex 78: X:-0.3523 Y:-2.5606 Z:-2.8056 U:0.8036 V:0.7098 +Vertex 79: X:0.7678 Y:-1.0448 Z:-2.5644 U:0.7525 V:0.8900 +Vertex 80: X:-3.3753 Y:-1.6884 Z:-0.3637 U:0.5001 V:0.0862 +Vertex 81: X:-1.5187 Y:-4.4011 Z:-3.7930 U:0.9606 V:0.5396 +Vertex 82: X:-0.8047 Y:-4.8053 Z:-3.1296 U:0.8585 V:0.6682 +Vertex 83: X:-1.9359 Y:-2.7587 Z:-3.2785 U:0.8916 V:0.4251 +Vertex 84: X:-4.0845 Y:-4.0562 Z:-1.3600 U:0.6530 V:0.0105 +Vertex 85: X:-4.0557 Y:-4.5166 Z:-2.8216 U:0.8585 V:0.0495 +Vertex 86: X:-3.4184 Y:-4.2324 Z:-3.6130 U:0.9606 V:0.1781 +Vertex 87: X:-0.6969 Y:-5.7733 Z:-1.0846 U:0.5713 V:0.6682 +Vertex 88: X:-1.3343 Y:-6.0576 Z:-0.2933 U:0.4691 V:0.5396 +Vertex 89: X:-2.1486 Y:-4.6071 Z:0.9693 U:0.3007 V:0.3407 +Vertex 90: X:-3.2340 Y:-5.8889 Z:-0.1133 U:0.4691 V:0.1781 +Vertex 91: X:-3.9480 Y:-5.4847 Z:-0.7766 U:0.5713 V:0.0495 +Vertex 92: X:0.8034 Y:5.8989 Z:-1.8978 U:0.6483 V:0.7695 +Vertex 93: X:1.0279 Y:5.9289 Z:0.4783 U:0.3116 V:0.7688 +Vertex 94: X:-0.1537 Y:-3.8222 Z:-2.1096 U:0.7051 V:0.7556 +Vertex 95: X:1.1132 Y:5.8643 Z:-1.3986 U:0.5741 V:0.8191 +Vertex 96: X:0.9465 Y:5.8885 Z:-1.0601 U:0.5288 V:0.7815 +Vertex 97: X:0.7872 Y:6.1296 Z:-0.8799 U:0.5053 V:0.7445 +Vertex 98: X:0.6861 Y:6.1495 Z:-0.6390 U:0.4728 V:0.7210 +Vertex 99: X:-0.9877 Y:6.0603 Z:-1.0013 U:0.5462 V:0.4156 +Vertex 100: X:-0.5996 Y:6.0140 Z:-1.6679 U:0.6347 V:0.5009 +Vertex 101: X:0.9959 Y:5.9278 Z:1.0930 U:0.2257 V:0.7520 +Vertex 102: X:0.8191 Y:5.9476 Z:1.3631 U:0.1901 V:0.7137 +Vertex 103: X:-0.3128 Y:6.0452 Z:1.3294 U:0.2099 V:0.5009 +Vertex 104: X:-0.8203 Y:6.0784 Z:0.7476 U:0.2984 V:0.4156 +Vertex 105: X:-0.0085 Y:6.2384 Z:0.6196 U:0.3052 V:0.5672 +Vertex 106: X:0.7300 Y:5.0489 Z:-3.0159 U:0.8075 V:0.7896 +Vertex 107: X:1.3698 Y:5.0000 Z:-2.7472 U:0.7613 V:0.9055 +Vertex 108: X:0.7001 Y:5.3513 Z:-2.8284 U:0.7812 V:0.7757 +Vertex 109: X:1.3394 Y:5.3027 Z:-2.5770 U:0.7373 V:0.8917 +Vertex 110: X:-1.6526 Y:5.5825 Z:-1.3580 U:0.6059 V:0.3054 +Vertex 111: X:-1.8168 Y:5.2987 Z:-1.4686 U:0.6241 V:0.2814 +Vertex 112: X:-1.0449 Y:5.5101 Z:-2.4019 U:0.7445 V:0.4389 +Vertex 113: X:-1.1767 Y:5.2224 Z:-2.5682 U:0.7700 V:0.4220 +Vertex 114: X:1.5384 Y:4.9970 Z:-2.1231 U:0.6714 V:0.9260 +Vertex 115: X:1.5076 Y:5.2990 Z:-1.9915 U:0.6529 V:0.9129 +Vertex 116: X:1.2818 Y:5.3265 Z:-1.4501 U:0.5798 V:0.8606 +Vertex 117: X:1.4677 Y:5.0648 Z:1.2194 U:0.2029 V:0.8524 +Vertex 118: X:1.3960 Y:5.3648 Z:1.1047 U:0.2195 V:0.8360 +Vertex 119: X:1.4282 Y:5.0818 Z:1.9444 U:0.1016 V:0.8318 +Vertex 120: X:1.1346 Y:5.1146 Z:2.3941 U:0.0424 V:0.7684 +Vertex 121: X:1.3489 Y:5.3816 Z:1.7845 U:0.1247 V:0.8148 +Vertex 122: X:1.0631 Y:5.4134 Z:2.2113 U:0.0686 V:0.7532 +Vertex 123: X:-0.7072 Y:5.2734 Z:2.3389 U:0.0746 V:0.4220 +Vertex 124: X:-1.5444 Y:5.3283 Z:1.3792 U:0.2205 V:0.2814 +Vertex 125: X:-0.6099 Y:5.5573 Z:2.1447 U:0.1002 V:0.4389 +Vertex 126: X:-1.4047 Y:5.6094 Z:1.2337 U:0.2387 V:0.3054 +Vertex 127: X:0.8365 Y:0.1492 Z:-2.8524 U:0.7903 V:0.8881 +Vertex 128: X:0.2950 Y:0.4010 Z:-3.0643 U:0.8269 V:0.7863 +Vertex 129: X:-2.4717 Y:0.2736 Z:-1.4073 U:0.6316 V:0.2412 +Vertex 130: X:-1.7985 Y:0.3707 Z:-2.5817 U:0.7873 V:0.3865 +Vertex 131: X:1.3448 Y:0.0208 Z:-2.1844 U:0.6898 V:0.9735 +Vertex 132: X:1.4024 Y:-0.0528 Z:-1.5434 U:0.5992 V:0.9742 +Vertex 133: X:1.2247 Y:0.2801 Z:-2.1473 U:0.6859 V:0.9461 +Vertex 134: X:1.1497 Y:0.2590 Z:-1.5453 U:0.6024 V:0.9218 +Vertex 135: X:1.5471 Y:-0.4431 Z:0.9701 U:0.2449 V:0.9632 +Vertex 136: X:1.4467 Y:-0.5530 Z:1.7793 U:0.1328 V:0.9319 +Vertex 137: X:1.2919 Y:0.1301 Z:0.9129 U:0.2555 V:0.9069 +Vertex 138: X:1.0619 Y:-0.6306 Z:2.5415 U:0.0310 V:0.8476 +Vertex 139: X:0.6344 Y:-0.6140 Z:2.7307 U:0.0102 V:0.7640 +Vertex 140: X:1.0985 Y:0.0577 Z:2.3185 U:0.0608 V:0.8470 +Vertex 141: X:0.7388 Y:0.0839 Z:2.6615 U:0.0175 V:0.7731 +Vertex 142: X:-2.0922 Y:0.3975 Z:1.5630 U:0.2093 V:0.2576 +Vertex 143: X:-0.0206 Y:-1.7185 Z:-2.8353 U:0.8021 V:0.7584 +Vertex 144: X:-2.4047 Y:-1.1937 Z:-2.5856 U:0.7983 V:0.2991 +Vertex 145: X:0.4916 Y:-2.0244 Z:-2.2954 U:0.7199 V:0.8498 +Vertex 146: X:0.9510 Y:-1.1378 Z:-2.2636 U:0.7079 V:0.9205 +Vertex 147: X:1.1319 Y:-1.3218 Z:-1.6746 U:0.6231 V:0.9470 +Vertex 148: X:0.5153 Y:-2.9471 Z:0.4603 U:0.3340 V:0.8207 +Vertex 149: X:-0.0687 Y:-3.0800 Z:1.3763 U:0.2134 V:0.6974 +Vertex 150: X:-1.8807 Y:-1.8401 Z:2.1602 U:0.1258 V:0.3237 +Vertex 151: X:-2.6986 Y:-1.4516 Z:1.2433 U:0.2650 V:0.1804 +Vertex 152: X:-0.7072 Y:-4.0367 Z:-3.0377 U:0.8431 V:0.6720 +Vertex 153: X:-1.0797 Y:-3.0214 Z:-3.2133 U:0.8713 V:0.5886 +Vertex 154: X:-0.5689 Y:-3.3153 Z:-2.8800 U:0.8181 V:0.6832 +Vertex 155: X:-2.9168 Y:-2.6554 Z:-2.9076 U:0.8525 V:0.2332 +Vertex 156: X:-1.3298 Y:-5.3967 Z:0.1591 U:0.4046 V:0.5214 +Vertex 157: X:-0.3590 Y:-4.5604 Z:-0.2337 U:0.4455 V:0.6962 +Vertex 158: X:-3.2422 Y:-5.0790 Z:0.3393 U:0.4045 V:0.1550 +Vertex 159: X:-3.8451 Y:-4.5948 Z:-0.3375 U:0.5070 V:0.0461 +Vertex 160: X:-3.0726 Y:-4.2465 Z:0.7743 U:0.3400 V:0.1652 +Vertex 161: X:-3.6694 Y:-3.7331 Z:0.0768 U:0.4452 V:0.0574 +Face list: +Face 0: A:108 B:46 C:17 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 1: A:19 B:2 C:18 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 2: A:92 B:0 C:97 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 3: A:92 B:108 C:17 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 4: A:92 B:19 C:18 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 5: A:17 B:0 C:92 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 6: A:18 B:108 C:92 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 7: A:97 B:19 C:92 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 8: A:20 B:1 C:22 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 9: A:93 B:20 C:22 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 10: A:21 B:20 C:93 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 11: A:10 B:23 C:24 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 12: A:9 B:10 C:24 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 13: A:25 B:14 C:28 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 14: A:27 B:12 C:145 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 15: A:94 B:25 C:28 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 16: A:94 B:147 C:26 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 17: A:94 B:27 C:145 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 18: A:26 B:25 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 19: A:145 B:147 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 20: A:28 B:27 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 21: A:29 B:0 C:31 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 22: A:31 B:30 C:1 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 23: A:1 B:29 C:31 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 24: A:96 B:95 C:98 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 25: A:97 B:98 C:95 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 26: A:32 B:2 C:95 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 27: A:19 B:95 C:2 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 28: A:53 B:96 C:21 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 29: A:20 B:98 C:1 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 30: A:0 B:29 C:97 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 31: A:95 B:96 C:32 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 32: A:98 B:20 C:96 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 33: A:21 B:96 C:20 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 34: A:29 B:1 C:97 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 35: A:98 B:97 C:1 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 36: A:95 B:19 C:97 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 37: A:0 B:99 C:31 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 38: A:99 B:34 C:33 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 39: A:48 B:33 C:34 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 40: A:17 B:46 C:100 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 41: A:35 B:100 C:46 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 42: A:33 B:31 C:99 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 43: A:100 B:35 C:99 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 44: A:34 B:99 C:35 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 45: A:0 B:17 C:100 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 46: A:99 B:0 C:100 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 47: A:102 B:101 C:39 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 48: A:22 B:39 C:101 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 49: A:36 B:93 C:101 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 50: A:102 B:38 C:37 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 51: A:57 B:37 C:38 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 52: A:30 B:31 C:39 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 53: A:1 B:30 C:22 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 54: A:37 B:36 C:102 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 55: A:101 B:102 C:36 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 56: A:38 B:102 C:39 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 57: A:39 B:22 C:30 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 58: A:101 B:93 C:22 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 59: A:105 B:104 C:103 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 60: A:40 B:57 C:103 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 61: A:38 B:103 C:57 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 62: A:104 B:33 C:41 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 63: A:48 B:41 C:33 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 64: A:105 B:39 C:31 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 65: A:41 B:40 C:104 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 66: A:103 B:104 C:40 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 67: A:33 B:104 C:31 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 68: A:104 B:105 C:31 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 69: A:103 B:38 C:105 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 70: A:39 B:105 C:38 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 71: A:107 B:106 C:109 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 72: A:108 B:109 C:106 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 73: A:42 B:3 C:106 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 74: A:47 B:106 C:3 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 75: A:107 B:44 C:43 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 76: A:4 B:43 C:44 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 77: A:18 B:2 C:109 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 78: A:45 B:109 C:2 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 79: A:43 B:42 C:107 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 80: A:106 B:107 C:42 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 81: A:109 B:45 C:107 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 82: A:44 B:107 C:45 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 83: A:109 B:108 C:18 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 84: A:106 B:47 C:108 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 85: A:46 B:108 C:47 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 86: A:111 B:110 C:113 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 87: A:112 B:113 C:110 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 88: A:34 B:110 C:48 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 89: A:47 B:3 C:113 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 90: A:50 B:113 C:3 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 91: A:112 B:35 C:46 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 92: A:49 B:48 C:111 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 93: A:110 B:111 C:48 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 94: A:113 B:50 C:111 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 95: A:46 B:47 C:112 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 96: A:113 B:112 C:47 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 97: A:110 B:34 C:112 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 98: A:35 B:112 C:34 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 99: A:115 B:116 C:114 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 100: A:51 B:4 C:114 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 101: A:44 B:114 C:4 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 102: A:96 B:53 C:116 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 103: A:115 B:45 C:32 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 104: A:2 B:32 C:45 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 105: A:114 B:116 C:51 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 106: A:52 B:116 C:53 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 107: A:32 B:96 C:115 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 108: A:116 B:115 C:96 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 109: A:114 B:44 C:115 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 110: A:45 B:115 C:44 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 111: A:117 B:52 C:118 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 112: A:118 B:53 C:21 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 113: A:21 B:93 C:118 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 114: A:53 B:118 C:52 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 115: A:120 B:119 C:122 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 116: A:121 B:122 C:119 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 117: A:54 B:117 C:119 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 118: A:120 B:56 C:55 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 119: A:5 B:55 C:56 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 120: A:37 B:57 C:122 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 121: A:121 B:118 C:36 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 122: A:93 B:36 C:118 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 123: A:55 B:54 C:120 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 124: A:119 B:120 C:54 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 125: A:122 B:57 C:120 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 126: A:56 B:120 C:57 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 127: A:36 B:37 C:121 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 128: A:122 B:121 C:37 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 129: A:119 B:117 C:121 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 130: A:118 B:121 C:117 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 131: A:124 B:123 C:126 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 132: A:125 B:126 C:123 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 133: A:58 B:5 C:123 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 134: A:56 B:123 C:5 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 135: A:41 B:48 C:126 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 136: A:125 B:57 C:40 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 137: A:123 B:124 C:58 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 138: A:126 B:48 C:124 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 139: A:49 B:124 C:48 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 140: A:40 B:41 C:125 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 141: A:126 B:125 C:41 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 142: A:123 B:56 C:125 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 143: A:57 B:125 C:56 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 144: A:6 B:43 C:4 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 145: A:50 B:130 C:129 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 146: A:67 B:49 C:129 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 147: A:111 B:129 C:49 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 148: A:130 B:50 C:3 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 149: A:129 B:111 C:50 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 150: A:59 B:6 C:51 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 151: A:60 B:59 C:116 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 152: A:51 B:116 C:59 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 153: A:60 B:116 C:52 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 154: A:4 B:51 C:6 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 155: A:61 B:60 C:117 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 156: A:52 B:117 C:60 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 157: A:62 B:61 C:54 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 158: A:117 B:54 C:61 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 159: A:55 B:75 C:63 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 160: A:63 B:62 C:55 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 161: A:54 B:55 C:62 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 162: A:75 B:55 C:5 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 163: A:124 B:49 C:142 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 164: A:67 B:142 C:49 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 165: A:142 B:58 C:124 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 166: A:5 B:58 C:75 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 167: A:7 B:127 C:64 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 168: A:43 B:6 C:127 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 169: A:65 B:127 C:6 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 170: A:128 B:66 C:42 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 171: A:3 B:42 C:66 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 172: A:64 B:127 C:65 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 173: A:42 B:43 C:128 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 174: A:127 B:128 C:43 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 175: A:3 B:66 C:130 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 176: A:132 B:131 C:134 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 177: A:133 B:134 C:131 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 178: A:68 B:7 C:131 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 179: A:64 B:131 C:7 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 180: A:8 B:69 C:132 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 181: A:137 B:134 C:60 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 182: A:133 B:65 C:59 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 183: A:6 B:59 C:65 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 184: A:69 B:68 C:132 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 185: A:131 B:132 C:68 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 186: A:134 B:137 C:132 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 187: A:59 B:60 C:133 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 188: A:134 B:133 C:60 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 189: A:131 B:64 C:133 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 190: A:65 B:133 C:64 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 191: A:136 B:135 C:73 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 192: A:137 B:73 C:135 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 193: A:70 B:8 C:135 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 194: A:132 B:135 C:8 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 195: A:136 B:72 C:71 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 196: A:9 B:71 C:72 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 197: A:71 B:70 C:136 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 198: A:135 B:136 C:70 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 199: A:72 B:136 C:73 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 200: A:60 B:61 C:137 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 201: A:73 B:137 C:61 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 202: A:135 B:132 C:137 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 203: A:139 B:138 C:141 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 204: A:140 B:141 C:138 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 205: A:72 B:138 C:9 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 206: A:139 B:74 C:10 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 207: A:63 B:75 C:141 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 208: A:140 B:73 C:62 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 209: A:61 B:62 C:73 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 210: A:10 B:9 C:139 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 211: A:138 B:139 C:9 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 212: A:141 B:75 C:139 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 213: A:74 B:139 C:75 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 214: A:62 B:63 C:140 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 215: A:141 B:140 C:63 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 216: A:138 B:72 C:140 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 217: A:73 B:140 C:72 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 218: A:151 B:76 C:142 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 219: A:74 B:76 C:10 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 220: A:76 B:75 C:58 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 221: A:142 B:67 C:151 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 222: A:58 B:142 C:76 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 223: A:75 B:76 C:74 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 224: A:128 B:143 C:77 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 225: A:143 B:145 C:78 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 226: A:12 B:78 C:145 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 227: A:127 B:7 C:143 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 228: A:79 B:143 C:7 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 229: A:78 B:77 C:143 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 230: A:145 B:143 C:79 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 231: A:143 B:128 C:127 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 232: A:77 B:11 C:128 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 233: A:66 B:128 C:11 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 234: A:155 B:144 C:11 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 235: A:144 B:130 C:66 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 236: A:80 B:67 C:129 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 237: A:144 B:155 C:129 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 238: A:66 B:11 C:144 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 239: A:130 B:144 C:129 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 240: A:146 B:147 C:145 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 241: A:26 B:147 C:8 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 242: A:69 B:8 C:147 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 243: A:146 B:79 C:68 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 244: A:7 B:68 C:79 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 245: A:68 B:69 C:146 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 246: A:147 B:146 C:69 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 247: A:79 B:146 C:145 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 248: A:149 B:148 C:9 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 249: A:157 B:26 C:148 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 250: A:8 B:148 C:26 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 251: A:149 B:23 C:156 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 252: A:89 B:156 C:23 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 253: A:148 B:8 C:70 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 254: A:156 B:157 C:149 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 255: A:148 B:149 C:157 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 256: A:9 B:24 C:149 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 257: A:23 B:149 C:24 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 258: A:70 B:71 C:148 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 259: A:9 B:148 C:71 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 260: A:23 B:150 C:89 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 261: A:150 B:10 C:76 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 262: A:80 B:151 C:67 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 263: A:76 B:151 C:150 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 264: A:10 B:150 C:23 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 265: A:152 B:153 C:154 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 266: A:81 B:13 C:153 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 267: A:83 B:153 C:13 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 268: A:152 B:28 C:82 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 269: A:14 B:82 C:28 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 270: A:78 B:12 C:154 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 271: A:27 B:154 C:12 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 272: A:153 B:83 C:77 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 273: A:11 B:77 C:83 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 274: A:82 B:81 C:152 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 275: A:153 B:152 C:81 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 276: A:154 B:27 C:152 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 277: A:28 B:152 C:27 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 278: A:77 B:78 C:153 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 279: A:154 B:153 C:78 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 280: A:84 B:80 C:85 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 281: A:129 B:85 C:80 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 282: A:16 B:84 C:85 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 283: A:83 B:13 C:155 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 284: A:86 B:155 C:13 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 285: A:11 B:83 C:155 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 286: A:155 B:86 C:85 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 287: A:85 B:129 C:155 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 288: A:87 B:14 C:157 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 289: A:25 B:157 C:14 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 290: A:156 B:89 C:88 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 291: A:15 B:88 C:89 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 292: A:88 B:87 C:156 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 293: A:157 B:156 C:87 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 294: A:26 B:157 C:25 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 295: A:159 B:158 C:161 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 296: A:160 B:161 C:158 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 297: A:90 B:15 C:158 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 298: A:89 B:158 C:15 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 299: A:159 B:84 C:91 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 300: A:16 B:91 C:84 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 301: A:151 B:80 C:161 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 302: A:84 B:161 C:80 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 303: A:160 B:89 C:150 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 304: A:91 B:90 C:159 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 305: A:158 B:159 C:90 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 306: A:161 B:84 C:159 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 307: A:150 B:151 C:160 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 308: A:161 B:160 C:151 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 309: A:158 B:89 C:160 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 310: A:91 B:16 C:82 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 311: A:85 B:82 C:16 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 312: A:82 B:88 C:90 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 313: A:15 B:90 C:88 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 314: A:87 B:82 C:14 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 315: A:82 B:86 C:81 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 316: A:13 B:81 C:86 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 317: A:90 B:91 C:82 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 318: A:88 B:82 C:87 AB:1 BC:0 CA:1 +Smoothing: 1 +Face 319: A:86 B:82 C:85 AB:1 BC:0 CA:1 +Smoothing: 1 + diff --git a/data/leftpalm.asc b/data/leftpalm.asc new file mode 100644 index 0000000..51d717e --- /dev/null +++ b/data/leftpalm.asc @@ -0,0 +1,1221 @@ +Ambient light color: Red=0.0000 Green=0.0000 Blue=0.0000 + +Named object: "Cylinder03" +Tri-mesh, Vertices: 249 Faces: 482 +Mapped +Vertex list: +Vertex 0: X:0.0122 Y:0.1323 Z:0.1321 U:0.5287 V:0.4741 +Vertex 1: X:-0.6946 Y:0.0896 Z:0.5403 U:0.6850 V:0.4741 +Vertex 2: X:-0.7863 Y:0.2991 Z:0.1843 U:0.6640 V:0.5505 +Vertex 3: X:-0.6639 Y:0.4640 Z:-0.1856 U:0.6069 V:0.6065 +Vertex 4: X:-0.3604 Y:0.5400 Z:-0.4705 U:0.5287 V:0.6270 +Vertex 5: X:0.0429 Y:0.5067 Z:-0.5939 U:0.4506 V:0.6065 +Vertex 6: X:0.4380 Y:0.3732 Z:-0.5227 U:0.3934 V:0.5505 +Vertex 7: X:0.7191 Y:0.1751 Z:-0.2761 U:0.3725 V:0.4741 +Vertex 8: X:0.8107 Y:-0.0345 Z:0.0798 U:0.3934 V:0.3977 +Vertex 9: X:0.6884 Y:-0.1994 Z:0.4498 U:0.4506 V:0.3417 +Vertex 10: X:0.3849 Y:-0.2753 Z:0.7346 U:0.5287 V:0.3213 +Vertex 11: X:-0.0185 Y:-0.2421 Z:0.8580 U:0.6069 V:0.3417 +Vertex 12: X:-0.4136 Y:-0.1085 Z:0.7869 U:0.6640 V:0.3977 +Vertex 13: X:-0.1342 Y:2.3926 Z:1.7518 U:0.6850 V:0.4741 +Vertex 14: X:-0.2259 Y:2.6021 Z:1.3959 U:0.6640 V:0.5505 +Vertex 15: X:-0.1035 Y:2.7670 Z:1.0259 U:0.6069 V:0.6065 +Vertex 16: X:0.2000 Y:2.8430 Z:0.7411 U:0.5287 V:0.6270 +Vertex 17: X:0.6033 Y:2.8097 Z:0.6177 U:0.4506 V:0.6065 +Vertex 18: X:0.9985 Y:2.6762 Z:0.6888 U:0.3934 V:0.5505 +Vertex 19: X:1.2795 Y:2.4781 Z:0.9354 U:0.3725 V:0.4741 +Vertex 20: X:1.3711 Y:2.2685 Z:1.2914 U:0.3934 V:0.3977 +Vertex 21: X:1.2488 Y:2.1036 Z:1.6613 U:0.4506 V:0.3417 +Vertex 22: X:0.9453 Y:2.0277 Z:1.9462 U:0.5287 V:0.3213 +Vertex 23: X:0.5419 Y:2.0609 Z:2.0696 U:0.6069 V:0.3417 +Vertex 24: X:0.1468 Y:2.1945 Z:1.9984 U:0.6640 V:0.3977 +Vertex 25: X:0.5726 Y:2.4353 Z:1.3436 U:0.5287 V:0.4741 +Vertex 26: X:0.8938 Y:-1.3619 Z:-3.2568 U:0.0744 V:0.7268 +Vertex 27: X:0.9303 Y:-2.3742 Z:-1.4305 U:0.2528 V:0.3775 +Vertex 28: X:0.6040 Y:-1.0339 Z:-3.0693 U:0.1369 V:0.7562 +Vertex 29: X:1.2994 Y:-0.9844 Z:-3.0557 U:0.0228 V:0.6997 +Vertex 30: X:0.9069 Y:-0.7520 Z:-2.9191 U:0.0984 V:0.7360 +Vertex 31: X:1.5526 Y:-0.5167 Z:-2.8015 U:0.0005 V:0.6867 +Vertex 32: X:1.0960 Y:-0.4028 Z:-2.7293 U:0.0817 V:0.7263 +Vertex 33: X:1.6286 Y:-0.0049 Z:-2.5193 U:0.0098 V:0.6890 +Vertex 34: X:1.1527 Y:-0.0206 Z:-2.5185 U:0.0887 V:0.7280 +Vertex 35: X:1.5200 Y:0.5009 Z:-2.2368 U:0.0496 V:0.7065 +Vertex 36: X:1.5929 Y:-1.5238 Z:1.4160 U:0.4066 V:0.0079 +Vertex 37: X:1.0716 Y:0.3571 Z:-2.3075 U:0.1184 V:0.7411 +Vertex 38: X:1.2373 Y:0.9509 Z:-1.9817 U:0.1162 V:0.7374 +Vertex 39: X:1.3102 Y:-1.0739 Z:1.6710 U:0.4731 V:0.0388 +Vertex 40: X:0.8605 Y:0.6932 Z:-2.1171 U:0.1682 V:0.7642 +Vertex 41: X:0.8084 Y:1.3008 Z:-1.7792 U:0.2030 V:0.7787 +Vertex 42: X:0.8813 Y:-0.7239 Z:1.8736 U:0.5599 V:0.0801 +Vertex 43: X:0.5402 Y:0.9545 Z:-1.9658 U:0.2329 V:0.7950 +Vertex 44: X:0.2755 Y:1.5164 Z:-1.6491 U:0.3013 V:0.8263 +Vertex 45: X:0.3484 Y:-0.5084 Z:2.0037 U:0.6582 V:0.1277 +Vertex 46: X:0.2151 Y:-0.9093 Z:1.7841 U:0.6633 V:0.1319 +Vertex 47: X:0.1422 Y:1.1154 Z:-1.8686 U:0.3064 V:0.8305 +Vertex 48: X:-0.3092 Y:1.5763 Z:-1.6042 U:0.4017 V:0.8756 +Vertex 49: X:-0.2363 Y:-0.4484 Z:2.0486 U:0.7586 V:0.1769 +Vertex 50: X:-0.2215 Y:-0.8645 Z:1.8176 U:0.7382 V:0.1687 +Vertex 51: X:-0.2944 Y:1.1602 Z:-1.8351 U:0.3813 V:0.8673 +Vertex 52: X:-0.8881 Y:1.4748 Z:-1.6489 U:0.4941 V:0.9216 +Vertex 53: X:-0.8152 Y:-0.5499 Z:2.0038 U:0.8510 V:0.2230 +Vertex 54: X:-0.6538 Y:-0.9403 Z:1.7842 U:0.8073 V:0.2031 +Vertex 55: X:-0.7267 Y:1.0844 Z:-1.8685 U:0.4504 V:0.9017 +Vertex 56: X:-1.4043 Y:1.2218 Z:-1.7788 U:0.5696 V:0.9599 +Vertex 57: X:-1.3314 Y:-0.8030 Z:1.8739 U:0.9265 V:0.2613 +Vertex 58: X:-1.0393 Y:-1.1293 Z:1.6872 U:0.8636 V:0.2317 +Vertex 59: X:-1.1122 Y:0.8954 Z:-1.9656 U:0.5067 V:0.9303 +Vertex 60: X:-1.8072 Y:0.8421 Z:-1.9813 U:0.6206 V:0.9868 +Vertex 61: X:-1.7343 Y:-1.1827 Z:1.6715 U:0.9776 V:0.2882 +Vertex 62: X:-1.3401 Y:-1.4128 Z:1.5360 U:0.9018 V:0.2518 +Vertex 63: X:-1.4130 Y:0.6119 Z:-2.1167 U:0.5448 V:0.9504 +Vertex 64: X:-2.0571 Y:0.3731 Z:-2.2362 U:0.6423 V:0.9995 +Vertex 65: X:-1.9842 Y:-1.6517 Z:1.4165 U:0.9992 V:0.3009 +Vertex 66: X:-1.5267 Y:-1.7631 Z:1.3456 U:0.9179 V:0.2612 +Vertex 67: X:-1.5996 Y:0.2617 Z:-2.3071 U:0.5610 V:0.9599 +Vertex 68: X:-2.1295 Y:-0.1391 Z:-2.5187 U:0.6324 V:0.9968 +Vertex 69: X:-2.0748 Y:-1.6577 Z:0.2208 U:0.9001 V:0.4729 +Vertex 70: X:-1.5990 Y:-1.6394 Z:0.2215 U:0.8213 V:0.4339 +Vertex 71: X:-1.6537 Y:-0.1208 Z:-2.5181 U:0.5536 V:0.9579 +Vertex 72: X:-2.0172 Y:-0.6443 Z:-2.8010 U:0.5920 V:0.9791 +Vertex 73: X:-1.5698 Y:-0.4981 Z:-2.7289 U:0.5234 V:0.9446 +Vertex 74: X:0.7854 Y:-2.2103 Z:-1.3367 U:0.2841 V:0.3922 +Vertex 75: X:-1.7571 Y:-1.5835 Z:-0.9386 U:0.7361 V:0.6125 +Vertex 76: X:1.3470 Y:-2.3067 Z:-0.6702 U:0.2559 V:0.2434 +Vertex 77: X:0.9340 Y:-2.4783 Z:-1.2427 U:0.2712 V:0.3415 +Vertex 78: X:0.9592 Y:-2.2063 Z:-0.2955 U:0.3547 V:0.2342 +Vertex 79: X:0.6509 Y:-2.3345 Z:-0.7230 U:0.3662 V:0.3075 +Vertex 80: X:1.6095 Y:-2.0961 Z:0.0477 U:0.2789 V:0.1417 +Vertex 81: X:1.1552 Y:-2.0490 Z:0.2406 U:0.3719 V:0.1582 +Vertex 82: X:1.6957 Y:-1.8672 Z:0.8405 U:0.3381 V:0.0464 +Vertex 83: X:1.2196 Y:-1.8781 Z:0.8326 U:0.4161 V:0.0871 +Vertex 84: X:1.6387 Y:-1.7374 Z:1.2966 U:0.3897 V:0.0005 +Vertex 85: X:1.1610 Y:-1.7445 Z:1.3023 U:0.4693 V:0.0398 +Vertex 86: X:-2.0640 Y:-1.9579 Z:0.7623 U:0.9530 V:0.3693 +Vertex 87: X:-2.0039 Y:-1.7913 Z:1.3395 U:0.9965 V:0.3001 +Vertex 88: X:-1.8718 Y:-1.7893 Z:1.3379 U:0.9745 V:0.2893 +Vertex 89: X:-1.5297 Y:-1.7843 Z:1.3339 U:0.9175 V:0.2611 +Vertex 90: X:-1.5880 Y:-1.9458 Z:0.7742 U:0.8753 V:0.3282 +Vertex 91: X:-1.9618 Y:-2.1822 Z:-0.0265 U:0.8631 V:0.4484 +Vertex 92: X:-1.5117 Y:-2.1133 Z:0.1852 U:0.8082 V:0.3873 +Vertex 93: X:-1.8576 Y:-2.1663 Z:0.0225 U:0.8503 V:0.4342 +Vertex 94: X:-0.4274 Y:0.0984 Z:0.1075 U:0.5994 V:0.5118 +Vertex 95: X:-0.7183 Y:0.1932 Z:0.3542 U:0.6701 V:0.5114 +Vertex 96: X:-0.3751 Y:-0.0099 Z:0.2893 U:0.6092 V:0.4722 +Vertex 97: X:-0.3693 Y:0.1849 Z:-0.0839 U:0.5707 V:0.5413 +Vertex 98: X:-0.7026 Y:0.3747 Z:0.0021 U:0.6321 V:0.5756 +Vertex 99: X:-0.2165 Y:0.2266 Z:-0.2337 U:0.5307 V:0.5528 +Vertex 100: X:-0.4955 Y:0.4912 Z:-0.3152 U:0.5664 V:0.6125 +Vertex 101: X:-0.0100 Y:0.2121 Z:-0.3017 U:0.4902 V:0.5432 +Vertex 102: X:-0.1523 Y:0.5115 Z:-0.5127 U:0.4906 V:0.6124 +Vertex 103: X:0.1950 Y:0.1453 Z:-0.2697 U:0.4600 V:0.5151 +Vertex 104: X:0.2350 Y:0.4303 Z:-0.5374 U:0.4250 V:0.5752 +Vertex 105: X:0.3435 Y:0.0443 Z:-0.1462 U:0.4483 V:0.4760 +Vertex 106: X:0.5626 Y:0.2692 Z:-0.3827 U:0.3872 V:0.5109 +Vertex 107: X:0.3957 Y:-0.0641 Z:0.0355 U:0.4581 V:0.4364 +Vertex 108: X:0.7427 Y:0.0714 Z:-0.0901 U:0.3874 V:0.4368 +Vertex 109: X:0.3377 Y:-0.1506 Z:0.2269 U:0.4868 V:0.4069 +Vertex 110: X:0.7271 Y:-0.1100 Z:0.2621 U:0.4254 V:0.3726 +Vertex 111: X:0.1849 Y:-0.1922 Z:0.3767 U:0.5268 V:0.3954 +Vertex 112: X:0.5199 Y:-0.2266 Z:0.5794 U:0.4911 V:0.3357 +Vertex 113: X:-0.0216 Y:-0.1777 Z:0.4447 U:0.5673 V:0.4050 +Vertex 114: X:0.1767 Y:-0.2469 Z:0.7769 U:0.5669 V:0.3358 +Vertex 115: X:-0.2266 Y:-0.1110 Z:0.4127 U:0.5974 V:0.4331 +Vertex 116: X:-0.2106 Y:-0.1657 Z:0.8016 U:0.6325 V:0.3730 +Vertex 117: X:-0.5381 Y:-0.0046 Z:0.6469 U:0.6702 V:0.4373 +Vertex 118: X:-0.5080 Y:1.3498 Z:0.9827 U:0.6838 V:0.5148 +Vertex 119: X:-0.1572 Y:2.4948 Z:1.5682 U:0.6702 V:0.5109 +Vertex 120: X:-0.4450 Y:1.2392 Z:1.1638 U:0.6917 V:0.4741 +Vertex 121: X:-0.5406 Y:1.4578 Z:0.7924 U:0.6699 V:0.5539 +Vertex 122: X:-0.4916 Y:1.5489 Z:0.5967 U:0.6422 V:0.5851 +Vertex 123: X:-0.1431 Y:2.6766 Z:1.2161 U:0.6325 V:0.5752 +Vertex 124: X:-0.4130 Y:1.6298 Z:0.4064 U:0.6102 V:0.6122 +Vertex 125: X:-0.2652 Y:1.6769 Z:0.2485 U:0.5703 V:0.6258 +Vertex 126: X:0.0629 Y:2.7937 Z:0.8982 U:0.5669 V:0.6124 +Vertex 127: X:-0.0964 Y:1.7091 Z:0.1092 U:0.5287 V:0.6336 +Vertex 128: X:0.1106 Y:1.6996 Z:0.0315 U:0.4872 V:0.6258 +Vertex 129: X:0.4054 Y:2.8148 Z:0.6997 U:0.4911 V:0.6125 +Vertex 130: X:0.3245 Y:1.6744 Z:-0.0195 U:0.4472 V:0.6122 +Vertex 131: X:0.5352 Y:1.6110 Z:0.0037 U:0.4152 V:0.5851 +Vertex 132: X:0.7927 Y:2.7342 Z:0.6737 U:0.4254 V:0.5756 +Vertex 133: X:0.7367 Y:1.5351 Z:0.0547 U:0.3876 V:0.5539 +Vertex 134: X:0.8947 Y:1.4346 Z:0.1726 U:0.3737 V:0.5148 +Vertex 135: X:1.1211 Y:2.5735 Z:0.8272 U:0.3874 V:0.5114 +Vertex 136: X:1.0299 Y:1.3284 Z:0.3119 U:0.3657 V:0.4741 +Vertex 137: X:1.0928 Y:1.2179 Z:0.4930 U:0.3737 V:0.4335 +Vertex 138: X:1.3025 Y:2.3758 Z:1.1191 U:0.3872 V:0.4373 +Vertex 139: X:1.1255 Y:1.1098 Z:0.6833 U:0.3876 V:0.3944 +Vertex 140: X:1.0765 Y:1.0188 Z:0.8790 U:0.4152 V:0.3631 +Vertex 141: X:1.2883 Y:2.1941 Z:1.4711 U:0.4250 V:0.3730 +Vertex 142: X:0.9978 Y:0.9378 Z:1.0693 U:0.4472 V:0.3360 +Vertex 143: X:0.8501 Y:0.8907 Z:1.2272 U:0.4872 V:0.3225 +Vertex 144: X:1.0823 Y:2.0770 Z:1.7890 U:0.4906 V:0.3358 +Vertex 145: X:0.6812 Y:0.8585 Z:1.3665 U:0.5287 V:0.3146 +Vertex 146: X:0.4742 Y:0.8680 Z:1.4442 U:0.5703 V:0.3225 +Vertex 147: X:0.7398 Y:2.0559 Z:1.9876 U:0.5664 V:0.3357 +Vertex 148: X:0.2604 Y:0.8932 Z:1.4952 U:0.6102 V:0.3360 +Vertex 149: X:0.0497 Y:0.9567 Z:1.4720 U:0.6422 V:0.3631 +Vertex 150: X:0.3525 Y:2.1364 Z:2.0136 U:0.6321 V:0.3726 +Vertex 151: X:-0.1519 Y:1.0325 Z:1.4210 U:0.6699 V:0.3944 +Vertex 152: X:-0.3098 Y:1.1330 Z:1.3031 U:0.6838 V:0.4335 +Vertex 153: X:0.0242 Y:2.2971 Z:1.8601 U:0.6701 V:0.4368 +Vertex 154: X:0.2320 Y:2.5336 Z:1.6069 U:0.6092 V:0.4760 +Vertex 155: X:0.1898 Y:2.6410 Z:1.4220 U:0.5974 V:0.5151 +Vertex 156: X:0.2578 Y:2.7243 Z:1.2324 U:0.5673 V:0.5432 +Vertex 157: X:0.4176 Y:2.7609 Z:1.0888 U:0.5268 V:0.5528 +Vertex 158: X:0.6264 Y:2.7412 Z:1.0297 U:0.4868 V:0.5413 +Vertex 159: X:0.8284 Y:2.6703 Z:1.0710 U:0.4581 V:0.5118 +Vertex 160: X:0.9693 Y:2.5674 Z:1.2015 U:0.4483 V:0.4722 +Vertex 161: X:1.0114 Y:2.4599 Z:1.3864 U:0.4600 V:0.4331 +Vertex 162: X:0.9435 Y:2.3767 Z:1.5760 U:0.4902 V:0.4050 +Vertex 163: X:0.7837 Y:2.3400 Z:1.7196 U:0.5307 V:0.3954 +Vertex 164: X:0.5748 Y:2.3597 Z:1.7787 U:0.5707 V:0.4069 +Vertex 165: X:0.3729 Y:2.4306 Z:1.7374 U:0.5994 V:0.4364 +Vertex 166: X:1.0883 Y:-1.1530 Z:-3.2047 U:0.0451 V:0.7225 +Vertex 167: X:0.9039 Y:-1.6403 Z:-2.7546 U:0.1235 V:0.6307 +Vertex 168: X:0.9149 Y:-2.1406 Z:-1.8326 U:0.2147 V:0.4560 +Vertex 169: X:0.9245 Y:-2.4307 Z:-1.3225 U:0.2647 V:0.3578 +Vertex 170: X:1.0056 Y:-2.4486 Z:-1.1434 U:0.2685 V:0.3245 +Vertex 171: X:0.6038 Y:-1.2939 Z:-2.5864 U:0.1857 V:0.6654 +Vertex 172: X:0.7476 Y:-0.8855 Z:-3.0197 U:0.1164 V:0.7510 +Vertex 173: X:0.9348 Y:-0.9709 Z:-3.1604 U:0.0729 V:0.7465 +Vertex 174: X:1.1064 Y:-0.8375 Z:-3.0301 U:0.0556 V:0.7263 +Vertex 175: X:0.7592 Y:-1.2164 Z:-3.1436 U:0.1060 V:0.7362 +Vertex 176: X:1.3255 Y:-0.4283 Z:-2.8076 U:0.0366 V:0.7151 +Vertex 177: X:1.3896 Y:0.0190 Z:-2.5610 U:0.0451 V:0.7174 +Vertex 178: X:1.2924 Y:0.4604 Z:-2.3144 U:0.0803 V:0.7328 +Vertex 179: X:1.4595 Y:-1.3205 Z:1.5612 U:0.4404 V:0.0182 +Vertex 180: X:1.0435 Y:0.8524 Z:-2.0921 U:0.1387 V:0.7600 +Vertex 181: X:0.7542 Y:-0.9260 Z:1.8238 U:0.5782 V:0.0789 +Vertex 182: X:0.7897 Y:-1.1904 Z:1.6168 U:0.5552 V:0.0798 +Vertex 183: X:0.6673 Y:1.1566 Z:-1.9160 U:0.2147 V:0.7961 +Vertex 184: X:0.2009 Y:1.3430 Z:-1.8034 U:0.3007 V:0.8378 +Vertex 185: X:0.0544 Y:-0.7037 Z:1.9610 U:0.7047 V:0.1404 +Vertex 186: X:-0.3100 Y:1.3933 Z:-1.7653 U:0.3882 V:0.8808 +Vertex 187: X:-0.4564 Y:-0.7147 Z:1.9650 U:0.7897 V:0.1824 +Vertex 188: X:-0.8152 Y:1.3027 Z:-1.8055 U:0.4688 V:0.9209 +Vertex 189: X:-0.9398 Y:-0.8636 Z:1.8922 U:0.8641 V:0.2197 +Vertex 190: X:-1.2650 Y:1.0799 Z:-1.9200 U:0.5345 V:0.9543 +Vertex 191: X:-1.5322 Y:-1.3177 Z:1.6523 U:0.9437 V:0.2610 +Vertex 192: X:-1.6152 Y:0.7469 Z:-2.0975 U:0.5787 V:0.9776 +Vertex 193: X:-1.9937 Y:-1.3997 Z:0.9558 U:0.9543 V:0.3887 +Vertex 194: X:-1.7701 Y:-1.7143 Z:1.4073 U:0.9636 V:0.2780 +Vertex 195: X:-1.5723 Y:-0.4976 Z:-0.9374 U:0.6949 V:0.6979 +Vertex 196: X:-1.8313 Y:0.3365 Z:-2.3207 U:0.5973 V:0.9885 +Vertex 197: X:-1.9251 Y:-1.7318 Z:1.3786 U:0.9866 V:0.2936 +Vertex 198: X:-1.9378 Y:-1.7903 Z:1.3387 U:0.9855 V:0.2947 +Vertex 199: X:-2.0013 Y:-1.7436 Z:1.3802 U:0.9995 V:0.2988 +Vertex 200: X:-1.5562 Y:-1.6963 Z:0.7979 U:0.8699 V:0.3455 +Vertex 201: X:-1.8922 Y:-0.1111 Z:-2.5676 U:0.5882 V:0.9860 +Vertex 202: X:-2.0195 Y:-0.9105 Z:-2.3216 U:0.6408 V:0.8883 +Vertex 203: X:-2.0800 Y:-0.3936 Z:-2.6906 U:0.6104 V:0.9926 +Vertex 204: X:-1.9631 Y:-1.9060 Z:-0.5183 U:0.8135 V:0.5421 +Vertex 205: X:-2.0233 Y:-1.9165 Z:0.0587 U:0.8787 V:0.4667 +Vertex 206: X:-1.5221 Y:-2.0547 Z:0.0649 U:0.7978 V:0.4102 +Vertex 207: X:-1.5241 Y:-2.0860 Z:0.2812 U:0.8191 V:0.3776 +Vertex 208: X:-1.5354 Y:-1.7698 Z:-0.4431 U:0.7487 V:0.5079 +Vertex 209: X:-1.6189 Y:-0.2987 Z:-2.6771 U:0.5345 V:0.9603 +Vertex 210: X:-1.8456 Y:-0.3369 Z:-2.7535 U:0.5651 V:0.9865 +Vertex 211: X:-1.7812 Y:-0.5834 Z:-2.7421 U:0.5579 V:0.9565 +Vertex 212: X:0.8352 Y:-2.0510 Z:-1.8824 U:0.2222 V:0.4780 +Vertex 213: X:0.8112 Y:-1.7714 Z:-2.3478 U:0.1789 V:0.5703 +Vertex 214: X:0.8465 Y:-2.3044 Z:-1.3979 U:0.2691 V:0.3866 +Vertex 215: X:0.7899 Y:-2.4051 Z:-0.9782 U:0.3195 V:0.3242 +Vertex 216: X:0.6798 Y:-1.8856 Z:-1.7360 U:0.2602 V:0.4865 +Vertex 217: X:0.6765 Y:-1.6259 Z:-2.2346 U:0.2105 V:0.5798 +Vertex 218: X:-1.8827 Y:-1.1233 Z:-1.9049 U:0.6601 V:0.7994 +Vertex 219: X:-1.8650 Y:-1.6706 Z:-0.9271 U:0.7560 V:0.6120 +Vertex 220: X:-1.8602 Y:-1.8990 Z:-0.4859 U:0.7996 V:0.5295 +Vertex 221: X:-1.6310 Y:-1.8105 Z:-0.4729 U:0.7620 V:0.5164 +Vertex 222: X:-1.6714 Y:-1.0380 Z:-1.8917 U:0.6255 V:0.7875 +Vertex 223: X:0.6513 Y:-2.1949 Z:-0.9644 U:0.3417 V:0.3537 +Vertex 224: X:1.6914 Y:-1.4441 Z:0.0742 U:0.2614 V:0.1919 +Vertex 225: X:1.6626 Y:-1.7747 Z:1.0308 U:0.3608 V:0.0316 +Vertex 226: X:1.6103 Y:-1.6095 Z:1.2882 U:0.3923 V:0.0160 +Vertex 227: X:1.4496 Y:-1.7402 Z:1.2989 U:0.4212 V:0.0161 +Vertex 228: X:1.4293 Y:-1.6681 Z:1.3990 U:0.4334 V:0.0107 +Vertex 229: X:1.2108 Y:-1.7438 Z:1.3017 U:0.4610 V:0.0357 +Vertex 230: X:1.3728 Y:-1.6292 Z:1.3918 U:0.4417 V:0.0202 +Vertex 231: X:-2.0204 Y:-1.7637 Z:1.1894 U:0.9846 V:0.3248 +Vertex 232: X:-1.6947 Y:-1.7879 Z:1.3650 U:0.9478 V:0.2706 +Vertex 233: X:-1.5356 Y:-1.7791 Z:1.3188 U:0.9170 V:0.2642 +Vertex 234: X:-1.7007 Y:-1.7868 Z:1.3359 U:0.9460 V:0.2752 +Vertex 235: X:-1.5452 Y:-1.7218 Z:0.8201 U:0.8704 V:0.3391 +Vertex 236: X:-1.5792 Y:-1.8004 Z:0.5255 U:0.8487 V:0.3753 +Vertex 237: X:-1.5668 Y:-1.8511 Z:1.0365 U:0.8959 V:0.2991 +Vertex 238: X:-1.9619 Y:-2.1918 Z:-0.0094 U:0.8648 V:0.4452 +Vertex 239: X:0.8547 Y:-2.3549 Z:-1.2731 U:0.2802 V:0.3640 +Vertex 240: X:0.6784 Y:-2.2349 Z:-1.0284 U:0.3315 V:0.3565 +Vertex 241: X:-1.9080 Y:-2.1626 Z:-0.0529 U:0.8514 V:0.4493 +Vertex 242: X:-1.6295 Y:-1.8594 Z:-0.3612 U:0.7729 V:0.4963 +Vertex 243: X:1.3999 Y:-1.7410 Z:1.2994 U:0.4295 V:0.0201 +Vertex 244: X:1.4187 Y:-1.8201 Z:1.1346 U:0.4115 V:0.0339 +Vertex 245: X:1.1903 Y:-1.8113 Z:1.0674 U:0.4427 V:0.0634 +Vertex 246: X:1.4900 Y:-1.8971 Z:0.8617 U:0.3744 V:0.0582 +Vertex 247: X:1.2528 Y:-1.4355 Z:1.5314 U:0.4729 V:0.0292 +Vertex 248: X:-1.7976 Y:-1.8688 Z:1.0965 U:0.9400 V:0.3088 +Face list: +Face 0: A:94 B:95 C:96 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 1: A:97 B:98 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 2: A:99 B:100 C:97 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 3: A:101 B:102 C:99 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 4: A:103 B:104 C:101 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 5: A:105 B:106 C:103 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 6: A:107 B:108 C:105 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 7: A:109 B:110 C:107 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 8: A:111 B:112 C:109 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 9: A:113 B:114 C:111 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 10: A:115 B:116 C:113 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 11: A:96 B:117 C:115 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 12: A:118 B:119 C:120 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 13: A:95 B:121 C:118 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 14: A:122 B:123 C:121 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 15: A:98 B:124 C:122 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 16: A:125 B:126 C:124 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 17: A:100 B:127 C:125 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 18: A:128 B:129 C:127 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 19: A:102 B:130 C:128 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 20: A:131 B:132 C:130 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 21: A:104 B:133 C:131 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 22: A:134 B:135 C:133 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 23: A:106 B:136 C:134 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 24: A:137 B:138 C:136 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 25: A:108 B:139 C:137 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 26: A:140 B:141 C:139 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 27: A:110 B:142 C:140 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 28: A:143 B:144 C:142 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 29: A:112 B:145 C:143 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 30: A:146 B:147 C:145 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 31: A:114 B:148 C:146 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 32: A:149 B:150 C:148 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 33: A:116 B:151 C:149 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 34: A:152 B:153 C:151 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 35: A:117 B:120 C:152 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 36: A:154 B:119 C:155 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 37: A:155 B:123 C:156 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 38: A:156 B:126 C:157 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 39: A:157 B:129 C:158 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 40: A:158 B:132 C:159 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 41: A:159 B:135 C:160 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 42: A:160 B:138 C:161 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 43: A:161 B:141 C:162 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 44: A:162 B:144 C:163 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 45: A:163 B:147 C:164 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 46: A:164 B:150 C:165 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 47: A:165 B:153 C:154 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 48: A:169 B:170 C:27 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 49: A:171 B:172 C:30 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 50: A:173 B:174 C:172 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 51: A:175 B:166 C:173 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 52: A:174 B:29 C:176 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 53: A:80 B:33 C:31 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 54: A:176 B:31 C:177 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 55: A:177 B:33 C:178 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 56: A:35 B:179 C:39 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 57: A:85 B:37 C:182 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 58: A:178 B:35 C:180 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 59: A:180 B:38 C:183 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 60: A:181 B:46 C:185 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 61: A:183 B:41 C:184 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 62: A:185 B:187 C:45 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 63: A:184 B:44 C:186 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 64: A:187 B:189 C:49 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 65: A:186 B:48 C:188 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 66: A:189 B:191 C:53 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 67: A:188 B:52 C:190 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 68: A:190 B:56 C:192 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 69: A:191 B:194 C:61 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 70: A:192 B:60 C:196 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 71: A:193 B:69 C:64 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 72: A:197 B:198 C:199 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 73: A:196 B:64 C:201 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 74: A:69 B:205 C:204 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 75: A:71 B:209 C:208 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 76: A:210 B:211 C:209 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 77: A:201 B:203 C:210 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 78: A:212 B:167 C:213 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 79: A:214 B:168 C:212 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 80: A:216 B:223 C:240 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 81: A:217 B:171 C:216 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 82: A:213 B:175 C:217 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 83: A:218 B:202 C:219 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 84: A:219 B:204 C:220 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 85: A:221 B:208 C:222 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 86: A:222 B:211 C:218 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 87: A:27 B:76 C:168 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 88: A:76 B:80 C:29 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 89: A:227 B:228 C:226 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 90: A:229 B:230 C:228 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 91: A:34 B:37 C:85 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 92: A:231 B:199 C:87 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 93: A:193 B:231 C:86 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 94: A:232 B:233 C:234 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 95: A:194 B:232 C:197 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 96: A:235 B:236 C:237 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 97: A:200 B:235 C:233 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 98: A:236 B:70 C:207 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 99: A:239 B:169 C:214 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 100: A:240 B:223 C:79 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 101: A:241 B:238 C:93 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 102: A:220 B:241 C:93 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 103: A:242 B:206 C:221 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 104: A:243 B:244 C:245 AB:1 BC:1 CA:1 + +Face 105: A:246 B:80 C:81 AB:1 BC:1 CA:1 + +Face 106: A:80 B:246 C:81 AB:1 BC:1 CA:1 + +Face 107: A:225 B:246 C:244 AB:1 BC:1 CA:1 + +Face 108: A:77 B:78 C:80 AB:1 BC:1 CA:1 + +Face 109: A:230 B:247 C:179 AB:1 BC:1 CA:1 + +Face 110: A:247 B:182 C:181 AB:1 BC:1 CA:1 + +Face 111: A:86 B:87 C:248 AB:1 BC:1 CA:1 + +Face 112: A:0 B:94 C:96 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 113: A:94 B:2 C:95 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 114: A:96 B:95 C:1 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 115: A:0 B:97 C:94 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 116: A:97 B:3 C:98 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 117: A:94 B:98 C:2 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 118: A:0 B:99 C:97 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 119: A:99 B:4 C:100 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 120: A:97 B:100 C:3 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 121: A:0 B:101 C:99 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 122: A:101 B:5 C:102 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 123: A:99 B:102 C:4 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 124: A:0 B:103 C:101 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 125: A:103 B:6 C:104 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 126: A:101 B:104 C:5 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 127: A:0 B:105 C:103 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 128: A:105 B:7 C:106 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 129: A:103 B:106 C:6 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 130: A:0 B:107 C:105 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 131: A:107 B:8 C:108 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 132: A:105 B:108 C:7 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 133: A:0 B:109 C:107 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 134: A:109 B:9 C:110 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 135: A:107 B:110 C:8 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 136: A:0 B:111 C:109 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 137: A:111 B:10 C:112 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 138: A:109 B:112 C:9 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 139: A:0 B:113 C:111 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 140: A:113 B:11 C:114 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 141: A:111 B:114 C:10 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 142: A:0 B:115 C:113 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 143: A:115 B:12 C:116 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 144: A:113 B:116 C:11 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 145: A:0 B:96 C:115 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 146: A:96 B:1 C:117 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 147: A:115 B:117 C:12 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 148: A:1 B:118 C:120 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 149: A:118 B:14 C:119 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 150: A:120 B:119 C:13 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 151: A:1 B:95 C:118 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 152: A:95 B:2 C:121 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 153: A:118 B:121 C:14 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 154: A:2 B:122 C:121 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 155: A:122 B:15 C:123 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 156: A:121 B:123 C:14 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 157: A:2 B:98 C:122 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 158: A:98 B:3 C:124 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 159: A:122 B:124 C:15 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 160: A:3 B:125 C:124 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 161: A:125 B:16 C:126 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 162: A:124 B:126 C:15 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 163: A:3 B:100 C:125 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 164: A:100 B:4 C:127 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 165: A:125 B:127 C:16 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 166: A:4 B:128 C:127 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 167: A:128 B:17 C:129 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 168: A:127 B:129 C:16 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 169: A:4 B:102 C:128 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 170: A:102 B:5 C:130 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 171: A:128 B:130 C:17 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 172: A:5 B:131 C:130 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 173: A:131 B:18 C:132 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 174: A:130 B:132 C:17 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 175: A:5 B:104 C:131 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 176: A:104 B:6 C:133 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 177: A:131 B:133 C:18 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 178: A:6 B:134 C:133 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 179: A:134 B:19 C:135 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 180: A:133 B:135 C:18 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 181: A:6 B:106 C:134 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 182: A:106 B:7 C:136 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 183: A:134 B:136 C:19 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 184: A:7 B:137 C:136 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 185: A:137 B:20 C:138 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 186: A:136 B:138 C:19 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 187: A:7 B:108 C:137 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 188: A:108 B:8 C:139 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 189: A:137 B:139 C:20 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 190: A:8 B:140 C:139 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 191: A:140 B:21 C:141 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 192: A:139 B:141 C:20 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 193: A:8 B:110 C:140 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 194: A:110 B:9 C:142 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 195: A:140 B:142 C:21 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 196: A:9 B:143 C:142 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 197: A:143 B:22 C:144 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 198: A:142 B:144 C:21 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 199: A:9 B:112 C:143 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 200: A:112 B:10 C:145 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 201: A:143 B:145 C:22 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 202: A:10 B:146 C:145 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 203: A:146 B:23 C:147 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 204: A:145 B:147 C:22 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 205: A:10 B:114 C:146 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 206: A:114 B:11 C:148 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 207: A:146 B:148 C:23 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 208: A:11 B:149 C:148 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 209: A:149 B:24 C:150 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 210: A:148 B:150 C:23 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 211: A:11 B:116 C:149 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 212: A:116 B:12 C:151 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 213: A:149 B:151 C:24 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 214: A:12 B:152 C:151 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 215: A:152 B:13 C:153 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 216: A:151 B:153 C:24 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 217: A:12 B:117 C:152 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 218: A:117 B:1 C:120 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 219: A:152 B:120 C:13 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 220: A:25 B:154 C:155 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 221: A:154 B:13 C:119 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 222: A:155 B:119 C:14 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 223: A:25 B:155 C:156 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 224: A:155 B:14 C:123 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 225: A:156 B:123 C:15 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 226: A:25 B:156 C:157 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 227: A:156 B:15 C:126 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 228: A:157 B:126 C:16 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 229: A:25 B:157 C:158 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 230: A:157 B:16 C:129 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 231: A:158 B:129 C:17 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 232: A:25 B:158 C:159 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 233: A:158 B:17 C:132 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 234: A:159 B:132 C:18 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 235: A:25 B:159 C:160 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 236: A:159 B:18 C:135 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 237: A:160 B:135 C:19 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 238: A:25 B:160 C:161 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 239: A:160 B:19 C:138 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 240: A:161 B:138 C:20 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 241: A:25 B:161 C:162 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 242: A:161 B:20 C:141 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 243: A:162 B:141 C:21 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 244: A:25 B:162 C:163 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 245: A:162 B:21 C:144 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 246: A:163 B:144 C:22 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 247: A:25 B:163 C:164 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 248: A:163 B:22 C:147 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 249: A:164 B:147 C:23 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 250: A:25 B:164 C:165 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 251: A:164 B:23 C:150 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 252: A:165 B:150 C:24 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 253: A:25 B:165 C:154 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 254: A:165 B:24 C:153 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 255: A:154 B:153 C:13 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 256: A:26 B:29 C:166 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 257: A:26 B:167 C:29 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 258: A:167 B:168 C:29 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 259: A:169 B:77 C:170 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 260: A:223 B:30 C:78 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 261: A:223 B:171 C:30 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 262: A:171 B:28 C:172 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 263: A:28 B:173 C:172 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 264: A:173 B:29 C:174 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 265: A:172 B:174 C:30 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 266: A:28 B:175 C:173 AB:1 BC:0 CA:0 +Smoothing: 3 +Face 267: A:175 B:26 C:166 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 268: A:173 B:166 C:29 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 269: A:29 B:80 C:31 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 270: A:78 B:30 C:32 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 271: A:30 B:176 C:32 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 272: A:30 B:174 C:176 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 273: A:176 B:29 C:31 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 274: A:32 B:177 C:34 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 275: A:32 B:176 C:177 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 276: A:177 B:31 C:33 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 277: A:33 B:224 C:35 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 278: A:224 B:36 C:35 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 279: A:34 B:178 C:37 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 280: A:34 B:177 C:178 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 281: A:178 B:33 C:35 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 282: A:35 B:39 C:38 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 283: A:35 B:36 C:179 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 284: A:37 B:40 C:182 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 285: A:37 B:180 C:40 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 286: A:37 B:178 C:180 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 287: A:180 B:35 C:38 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 288: A:38 B:42 C:41 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 289: A:38 B:39 C:42 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 290: A:39 B:181 C:42 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 291: A:182 B:40 C:43 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 292: A:40 B:183 C:43 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 293: A:40 B:180 C:183 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 294: A:183 B:38 C:41 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 295: A:41 B:45 C:44 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 296: A:41 B:42 C:45 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 297: A:42 B:185 C:45 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 298: A:42 B:181 C:185 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 299: A:181 B:182 C:46 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 300: A:182 B:43 C:46 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 301: A:43 B:47 C:46 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 302: A:43 B:184 C:47 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 303: A:43 B:183 C:184 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 304: A:184 B:41 C:44 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 305: A:44 B:49 C:48 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 306: A:44 B:45 C:49 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 307: A:185 B:50 C:187 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 308: A:45 B:187 C:49 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 309: A:185 B:46 C:50 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 310: A:46 B:51 C:50 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 311: A:46 B:47 C:51 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 312: A:47 B:186 C:51 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 313: A:47 B:184 C:186 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 314: A:186 B:44 C:48 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 315: A:48 B:53 C:52 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 316: A:48 B:49 C:53 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 317: A:187 B:54 C:189 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 318: A:49 B:189 C:53 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 319: A:187 B:50 C:54 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 320: A:50 B:55 C:54 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 321: A:50 B:51 C:55 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 322: A:51 B:188 C:55 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 323: A:51 B:186 C:188 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 324: A:188 B:48 C:52 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 325: A:52 B:57 C:56 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 326: A:52 B:53 C:57 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 327: A:189 B:58 C:191 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 328: A:53 B:191 C:57 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 329: A:189 B:54 C:58 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 330: A:54 B:59 C:58 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 331: A:54 B:55 C:59 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 332: A:55 B:190 C:59 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 333: A:55 B:188 C:190 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 334: A:190 B:52 C:56 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 335: A:56 B:61 C:60 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 336: A:56 B:57 C:61 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 337: A:57 B:191 C:61 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 338: A:191 B:58 C:62 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 339: A:58 B:63 C:62 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 340: A:58 B:59 C:63 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 341: A:59 B:192 C:63 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 342: A:59 B:190 C:192 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 343: A:192 B:56 C:60 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 344: A:60 B:193 C:64 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 345: A:60 B:61 C:193 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 346: A:193 B:61 C:65 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 347: A:191 B:66 C:194 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 348: A:61 B:194 C:65 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 349: A:191 B:62 C:66 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 350: A:62 B:195 C:66 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 351: A:62 B:63 C:195 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 352: A:63 B:67 C:195 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 353: A:63 B:196 C:67 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 354: A:63 B:192 C:196 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 355: A:196 B:60 C:64 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 356: A:64 B:69 C:68 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 357: A:65 B:197 C:199 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 358: A:197 B:88 C:198 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 359: A:199 B:198 C:87 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 360: A:66 B:195 C:200 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 361: A:200 B:195 C:70 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 362: A:195 B:71 C:70 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 363: A:195 B:67 C:71 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 364: A:67 B:201 C:71 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 365: A:67 B:196 C:201 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 366: A:201 B:64 C:68 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 367: A:68 B:202 C:203 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 368: A:203 B:202 C:72 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 369: A:68 B:69 C:202 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 370: A:69 B:204 C:202 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 371: A:204 B:205 C:238 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 372: A:207 B:206 C:92 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 373: A:70 B:208 C:206 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 374: A:70 B:71 C:208 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 375: A:208 B:209 C:73 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 376: A:71 B:210 C:209 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 377: A:210 B:72 C:211 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 378: A:209 B:211 C:73 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 379: A:71 B:201 C:210 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 380: A:201 B:68 C:203 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 381: A:210 B:203 C:72 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 382: A:74 B:212 C:213 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 383: A:213 B:167 C:26 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 384: A:74 B:214 C:212 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 385: A:214 B:27 C:168 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 386: A:212 B:168 C:167 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 387: A:74 B:215 C:239 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 388: A:239 B:215 C:77 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 389: A:74 B:216 C:240 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 390: A:74 B:217 C:216 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 391: A:217 B:28 C:171 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 392: A:216 B:171 C:223 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 393: A:74 B:213 C:217 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 394: A:213 B:26 C:175 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 395: A:217 B:175 C:28 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 396: A:75 B:218 C:219 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 397: A:218 B:72 C:202 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 398: A:219 B:202 C:204 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 399: A:75 B:219 C:220 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 400: A:220 B:204 C:238 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 401: A:75 B:93 C:242 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 402: A:75 B:221 C:222 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 403: A:221 B:206 C:208 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 404: A:222 B:208 C:73 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 405: A:75 B:222 C:218 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 406: A:222 B:73 C:211 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 407: A:218 B:211 C:72 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 408: A:27 B:170 C:76 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 409: A:168 B:76 C:29 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 410: A:79 B:223 C:78 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 411: A:81 B:78 C:32 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 412: A:80 B:82 C:224 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 413: A:80 B:224 C:33 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 414: A:83 B:81 C:34 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 415: A:81 B:32 C:34 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 416: A:224 B:82 C:225 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 417: A:224 B:225 C:84 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 418: A:224 B:84 C:226 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 419: A:224 B:226 C:36 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 420: A:84 B:227 C:226 AB:1 BC:0 CA:1 +Smoothing: 3 +Face 421: A:226 B:228 C:36 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 422: A:227 B:229 C:228 AB:1 BC:0 CA:0 +Smoothing: 3 +Face 423: A:229 B:85 C:230 AB:1 BC:0 CA:0 +Smoothing: 3 +Face 424: A:228 B:230 C:36 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 425: A:83 B:34 C:85 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 426: A:193 B:86 C:69 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 427: A:86 B:231 C:87 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 428: A:231 B:65 C:199 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 429: A:193 B:65 C:231 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 430: A:88 B:232 C:234 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 431: A:232 B:66 C:233 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 432: A:234 B:233 C:89 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 433: A:65 B:194 C:197 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 434: A:194 B:66 C:232 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 435: A:197 B:232 C:88 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 436: A:89 B:235 C:237 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 437: A:235 B:70 C:236 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 438: A:237 B:236 C:90 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 439: A:66 B:200 C:233 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 440: A:200 B:70 C:235 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 441: A:233 B:235 C:89 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 442: A:69 B:86 C:205 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 443: A:205 B:86 C:91 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 444: A:205 B:91 C:238 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 445: A:90 B:236 C:207 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 446: A:207 B:70 C:206 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 447: A:74 B:239 C:214 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 448: A:239 B:77 C:169 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 449: A:214 B:169 C:27 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 450: A:215 B:240 C:79 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 451: A:74 B:240 C:215 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 452: A:93 B:238 C:91 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 453: A:75 B:220 C:93 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 454: A:220 B:238 C:241 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 455: A:242 B:93 C:92 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 456: A:75 B:242 C:221 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 457: A:242 B:92 C:206 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 458: A:85 B:243 C:245 AB:1 BC:0 CA:1 + +Face 459: A:243 B:84 C:244 AB:1 BC:0 CA:0 + +Face 460: A:245 B:244 C:83 AB:0 BC:0 CA:1 + +Face 461: A:83 B:246 C:81 AB:0 BC:0 CA:0 + +Face 462: A:246 B:82 C:80 AB:0 BC:1 CA:0 + +Face 463: A:80 B:82 C:246 AB:1 BC:1 CA:0 + +Face 464: A:81 B:246 C:83 AB:0 BC:1 CA:1 + +Face 465: A:84 B:225 C:244 AB:1 BC:0 CA:0 + +Face 466: A:225 B:82 C:246 AB:1 BC:0 CA:0 + +Face 467: A:244 B:246 C:83 AB:0 BC:0 CA:0 + +Face 468: A:77 B:79 C:78 AB:0 BC:1 CA:0 + +Face 469: A:76 B:77 C:80 AB:0 BC:0 CA:0 + +Face 470: A:80 B:78 C:81 AB:0 BC:1 CA:0 + +Face 471: A:36 B:230 C:179 AB:0 BC:0 CA:1 + +Face 472: A:230 B:85 C:247 AB:0 BC:0 CA:0 + +Face 473: A:179 B:247 C:39 AB:0 BC:0 CA:1 + +Face 474: A:39 B:247 C:181 AB:0 BC:0 CA:0 + +Face 475: A:247 B:85 C:182 AB:0 BC:1 CA:0 + +Face 476: A:92 B:91 C:248 AB:1 BC:0 CA:0 + +Face 477: A:92 B:248 C:90 AB:0 BC:0 CA:1 + +Face 478: A:91 B:86 C:248 AB:1 BC:0 CA:0 + +Face 479: A:248 B:87 C:89 AB:0 BC:1 CA:0 + +Face 480: A:248 B:89 C:237 AB:0 BC:1 CA:0 + +Face 481: A:248 B:237 C:90 AB:0 BC:1 CA:0 + + diff --git a/data/menu.mp3 b/data/menu.mp3 new file mode 100644 index 0000000..92a901e Binary files /dev/null and b/data/menu.mp3 differ diff --git a/data/menuchange.wav b/data/menuchange.wav new file mode 100644 index 0000000..cd3ac8b Binary files /dev/null and b/data/menuchange.wav differ diff --git a/data/menuselect.wav b/data/menuselect.wav new file mode 100644 index 0000000..524b8e2 Binary files /dev/null and b/data/menuselect.wav differ diff --git a/data/perusnaama3.png b/data/perusnaama3.png new file mode 100644 index 0000000..4e8231d Binary files /dev/null and b/data/perusnaama3.png differ diff --git a/data/rightarm.asc b/data/rightarm.asc new file mode 100644 index 0000000..004a3f3 --- /dev/null +++ b/data/rightarm.asc @@ -0,0 +1,810 @@ +Ambient light color: Red=0.0000 Green=0.0000 Blue=0.0000 + +Named object: "BlockoHandRight" +Tri-mesh, Vertices: 162 Faces: 320 +Mapped +Vertex list: +Vertex 0: X:-0.3396 Y:6.4827 Z:-0.3438 U:0.4367 V:0.6319 +Vertex 1: X:-0.3939 Y:6.4821 Z:-0.2495 U:0.4227 V:0.6404 +Vertex 2: X:-1.7823 Y:5.6955 Z:-1.9743 U:0.6480 V:0.9382 +Vertex 3: X:0.0897 Y:4.6339 Z:-3.1671 U:0.8426 V:0.6169 +Vertex 4: X:-1.9842 Y:4.5610 Z:-2.4432 U:0.7134 V:0.9940 +Vertex 5: X:-0.4746 Y:4.7202 Z:2.7651 U:0.0020 V:0.6169 +Vertex 6: X:-1.7881 Y:0.9420 Z:-2.3719 U:0.7134 V:0.9865 +Vertex 7: X:-1.4993 Y:-0.1847 Z:-2.5700 U:0.7474 V:0.9453 +Vertex 8: X:-1.9750 Y:-0.6292 Z:-0.3795 U:0.4344 V:0.9995 +Vertex 9: X:-1.4042 Y:-1.1855 Z:2.5612 U:0.0303 V:0.8449 +Vertex 10: X:0.0527 Y:-1.2002 Z:2.7491 U:0.0234 V:0.5682 +Vertex 11: X:1.2196 Y:-2.0275 Z:-3.0829 U:0.8595 V:0.4596 +Vertex 12: X:-0.4274 Y:-2.6892 Z:-2.4606 U:0.7515 V:0.7633 +Vertex 13: X:1.9385 Y:-4.1956 Z:-3.9799 U:0.9995 V:0.3588 +Vertex 14: X:-0.0984 Y:-5.2343 Z:-2.1315 U:0.7149 V:0.7172 +Vertex 15: X:1.6413 Y:-6.1032 Z:0.0737 U:0.4303 V:0.3588 +Vertex 16: X:3.6782 Y:-5.0645 Z:-1.7747 U:0.7149 V:0.0005 +Vertex 17: X:-0.1049 Y:6.0447 Z:-1.9655 U:0.6684 V:0.6203 +Vertex 18: X:-1.3404 Y:5.7078 Z:-2.2760 U:0.6962 V:0.8605 +Vertex 19: X:-1.4457 Y:5.9900 Z:-1.5546 U:0.5930 V:0.8651 +Vertex 20: X:-0.7475 Y:6.2802 Z:-0.3071 U:0.4265 V:0.7095 +Vertex 21: X:-1.0331 Y:6.0347 Z:-0.3526 U:0.4296 V:0.7660 +Vertex 22: X:-0.7957 Y:6.2908 Z:0.3133 U:0.3387 V:0.7074 +Vertex 23: X:0.7303 Y:-2.8999 Z:1.9860 U:0.1430 V:0.4689 +Vertex 24: X:-0.6435 Y:-2.0387 Z:2.3390 U:0.0734 V:0.7132 +Vertex 25: X:-0.2625 Y:-4.7027 Z:-1.7143 U:0.6530 V:0.7361 +Vertex 26: X:-0.4861 Y:-4.0767 Z:-1.3472 U:0.5972 V:0.7663 +Vertex 27: X:-0.2352 Y:-3.5331 Z:-2.3753 U:0.7438 V:0.7328 +Vertex 28: X:-0.1255 Y:-4.3815 Z:-2.2656 U:0.7316 V:0.7174 +Vertex 29: X:-0.3712 Y:6.4743 Z:-0.3170 U:0.4325 V:0.6374 +Vertex 30: X:-0.3961 Y:6.4833 Z:-0.1844 U:0.4136 V:0.6396 +Vertex 31: X:-0.3207 Y:6.4871 Z:-0.1510 U:0.4099 V:0.6249 +Vertex 32: X:-1.4727 Y:5.7114 Z:-1.7734 U:0.6239 V:0.8764 +Vertex 33: X:0.9795 Y:6.1262 Z:-0.1106 U:0.4223 V:0.3831 +Vertex 34: X:1.2980 Y:5.8397 Z:-1.2469 U:0.5867 V:0.3459 +Vertex 35: X:0.7828 Y:5.8010 Z:-2.1281 U:0.7036 V:0.4586 +Vertex 36: X:-1.3344 Y:5.7789 Z:1.5211 U:0.1630 V:0.7915 +Vertex 37: X:-1.1006 Y:5.7948 Z:1.8816 U:0.1155 V:0.7410 +Vertex 38: X:-0.4353 Y:6.0953 Z:1.5082 U:0.1762 V:0.6203 +Vertex 39: X:-0.4019 Y:6.3152 Z:0.7688 U:0.2800 V:0.6252 +Vertex 40: X:0.4051 Y:5.8587 Z:1.8421 U:0.1410 V:0.4586 +Vertex 41: X:1.0773 Y:5.8734 Z:1.0731 U:0.2579 V:0.3459 +Vertex 42: X:-0.8718 Y:4.5937 Z:-3.1217 U:0.8235 V:0.7969 +Vertex 43: X:-1.5090 Y:4.5725 Z:-2.8412 U:0.7757 V:0.9118 +Vertex 44: X:-1.9910 Y:5.1373 Z:-2.3710 U:0.7020 V:0.9891 +Vertex 45: X:-1.9536 Y:5.4376 Z:-2.2388 U:0.6834 V:0.9772 +Vertex 46: X:0.0289 Y:5.5060 Z:-2.8763 U:0.7992 V:0.6158 +Vertex 47: X:0.0568 Y:5.2086 Z:-3.0614 U:0.8262 V:0.6164 +Vertex 48: X:1.6895 Y:5.6308 Z:-0.0359 U:0.4223 V:0.2527 +Vertex 49: X:1.8362 Y:5.3423 Z:-0.0177 U:0.4223 V:0.2273 +Vertex 50: X:1.1278 Y:4.6882 Z:-2.6601 U:0.7852 V:0.4126 +Vertex 51: X:-1.6797 Y:4.5773 Z:-2.1929 U:0.6823 V:0.9323 +Vertex 52: X:-1.4662 Y:5.1922 Z:-0.4148 U:0.4343 V:0.8555 +Vertex 53: X:-1.3925 Y:5.4907 Z:-0.4064 U:0.4335 V:0.8390 +Vertex 54: X:-1.6034 Y:4.6597 Z:2.0474 U:0.0878 V:0.8421 +Vertex 55: X:-1.3018 Y:4.6802 Z:2.5124 U:0.0265 V:0.7770 +Vertex 56: X:-0.4854 Y:5.2915 Z:2.6385 U:0.0184 V:0.6164 +Vertex 57: X:-0.4771 Y:5.5834 Z:2.4430 U:0.0454 V:0.6158 +Vertex 58: X:0.6406 Y:4.7627 Z:2.4615 U:0.0594 V:0.4126 +Vertex 59: X:-1.5027 Y:0.9574 Z:-2.1234 U:0.6823 V:0.9284 +Vertex 60: X:-1.3190 Y:0.9748 Z:-1.5546 U:0.6049 V:0.8837 +Vertex 61: X:-1.4843 Y:1.0232 Z:1.3618 U:0.1931 V:0.8626 +Vertex 62: X:-1.4470 Y:1.0389 Z:2.1150 U:0.0878 V:0.8421 +Vertex 63: X:-1.1454 Y:1.0594 Z:2.5799 U:0.0265 V:0.7770 +Vertex 64: X:-1.6570 Y:0.2006 Z:-2.5167 U:0.7371 V:0.9707 +Vertex 65: X:-1.7277 Y:0.4328 Z:-2.4293 U:0.7234 V:0.9805 +Vertex 66: X:0.4147 Y:0.3976 Z:-3.1118 U:0.8479 V:0.5907 +Vertex 67: X:2.1800 Y:0.4837 Z:0.0986 U:0.4205 V:0.2017 +Vertex 68: X:-1.6684 Y:-0.2386 Z:-2.2258 U:0.6969 V:0.9714 +Vertex 69: X:-1.8296 Y:-0.3632 Z:-1.5921 U:0.6061 V:0.9915 +Vertex 70: X:-1.9653 Y:-0.9117 Z:0.9443 U:0.2492 V:0.9766 +Vertex 71: X:-1.7389 Y:-1.0777 Z:1.8558 U:0.1246 V:0.9193 +Vertex 72: X:-1.6153 Y:-0.4701 Z:2.3488 U:0.0558 V:0.8823 +Vertex 73: X:-1.5464 Y:0.2008 Z:1.8936 U:0.1193 V:0.8717 +Vertex 74: X:-0.1362 Y:-0.4604 Z:2.8769 U:0.0014 V:0.5952 +Vertex 75: X:-0.2391 Y:0.2461 Z:2.8631 U:0.0005 V:0.6088 +Vertex 76: X:1.1625 Y:-1.0625 Z:2.4575 U:0.0789 V:0.3639 +Vertex 77: X:0.3693 Y:-2.2612 Z:-3.0474 U:0.8437 V:0.6205 +Vertex 78: X:-0.1195 Y:-2.4792 Z:-2.8056 U:0.8036 V:0.7098 +Vertex 79: X:-1.1724 Y:-0.9159 Z:-2.5644 U:0.7525 V:0.8900 +Vertex 80: X:2.9386 Y:-1.7397 Z:-0.3637 U:0.5001 V:0.0862 +Vertex 81: X:0.9655 Y:-4.3688 Z:-3.7930 U:0.9606 V:0.5396 +Vertex 82: X:0.2346 Y:-4.7415 Z:-3.1296 U:0.8585 V:0.6682 +Vertex 83: X:1.4540 Y:-2.7462 Z:-3.2785 U:0.8916 V:0.4251 +Vertex 84: X:3.5439 Y:-4.1362 Z:-1.3600 U:0.6530 V:0.0105 +Vertex 85: X:3.4951 Y:-4.5949 Z:-2.8216 U:0.8585 V:0.0495 +Vertex 86: X:2.8708 Y:-4.2831 Z:-3.6130 U:0.9606 V:0.1781 +Vertex 87: X:0.0847 Y:-5.7039 Z:-1.0846 U:0.5713 V:0.6682 +Vertex 88: X:0.7090 Y:-6.0157 Z:-0.2933 U:0.4691 V:0.5396 +Vertex 89: X:1.5858 Y:-4.6021 Z:0.9693 U:0.3007 V:0.3407 +Vertex 90: X:2.6142 Y:-5.9301 Z:-0.1133 U:0.4691 V:0.1781 +Vertex 91: X:3.3452 Y:-5.5573 Z:-0.7766 U:0.5713 V:0.0495 +Vertex 92: X:-0.9051 Y:6.0227 Z:-1.8978 U:0.6483 V:0.7695 +Vertex 93: X:-1.1280 Y:6.0624 Z:0.4783 U:0.3116 V:0.7688 +Vertex 94: X:-0.3729 Y:-3.7310 Z:-2.1096 U:0.7051 V:0.7556 +Vertex 95: X:-1.2161 Y:6.0016 Z:-1.3986 U:0.5741 V:0.8191 +Vertex 96: X:-1.0485 Y:6.0185 Z:-1.0601 U:0.5288 V:0.7815 +Vertex 97: X:-0.8789 Y:6.2524 Z:-0.8799 U:0.5053 V:0.7445 +Vertex 98: X:-0.7770 Y:6.2679 Z:-0.6390 U:0.4728 V:0.7210 +Vertex 99: X:0.8913 Y:6.1057 Z:-1.0013 U:0.5462 V:0.4156 +Vertex 100: X:0.5016 Y:6.0765 Z:-1.6679 U:0.6347 V:0.5009 +Vertex 101: X:-1.0961 Y:6.0599 Z:1.0930 U:0.2257 V:0.7520 +Vertex 102: X:-0.9187 Y:6.0720 Z:1.3631 U:0.1901 V:0.7137 +Vertex 103: X:0.2165 Y:6.1201 Z:1.3294 U:0.2099 V:0.5009 +Vertex 104: X:0.7249 Y:6.1312 Z:0.7476 U:0.2984 V:0.4156 +Vertex 105: X:-0.0791 Y:6.3264 Z:0.6196 U:0.3052 V:0.5672 +Vertex 106: X:-0.8688 Y:5.1703 Z:-3.0159 U:0.8075 V:0.7896 +Vertex 107: X:-1.5102 Y:5.1493 Z:-2.7472 U:0.7613 V:0.9055 +Vertex 108: X:-0.8257 Y:5.4711 Z:-2.8284 U:0.7812 V:0.7757 +Vertex 109: X:-1.4666 Y:5.4504 Z:-2.5770 U:0.7373 V:0.8917 +Vertex 110: X:1.5348 Y:5.5994 Z:-1.3580 U:0.6059 V:0.3054 +Vertex 111: X:1.6865 Y:5.3087 Z:-1.4686 U:0.6241 V:0.2814 +Vertex 112: X:0.9245 Y:5.5536 Z:-2.4019 U:0.7445 V:0.4389 +Vertex 113: X:1.0436 Y:5.2604 Z:-2.5682 U:0.7700 V:0.4220 +Vertex 114: X:-1.6787 Y:5.1537 Z:-2.1231 U:0.6714 V:0.9260 +Vertex 115: X:-1.6348 Y:5.4540 Z:-1.9915 U:0.6529 V:0.9129 +Vertex 116: X:-1.4080 Y:5.4717 Z:-1.4501 U:0.5798 V:0.8606 +Vertex 117: X:-1.6052 Y:5.2183 Z:1.2194 U:0.2029 V:0.8524 +Vertex 118: X:-1.5205 Y:5.5149 Z:1.1047 U:0.2195 V:0.8360 +Vertex 119: X:-1.5649 Y:5.2336 Z:1.9444 U:0.1016 V:0.8318 +Vertex 120: X:-1.2702 Y:5.2535 Z:2.3941 U:0.0424 V:0.7684 +Vertex 121: X:-1.4726 Y:5.5296 Z:1.7845 U:0.1247 V:0.8148 +Vertex 122: X:-1.1857 Y:5.5489 Z:2.2113 U:0.0686 V:0.7532 +Vertex 123: X:0.5768 Y:5.3318 Z:2.3389 U:0.0746 V:0.4220 +Vertex 124: X:1.4156 Y:5.3502 Z:1.3792 U:0.2205 V:0.2814 +Vertex 125: X:0.4920 Y:5.6197 Z:2.1447 U:0.1002 V:0.4389 +Vertex 126: X:1.2882 Y:5.6371 Z:1.2337 U:0.2387 V:0.3054 +Vertex 127: X:-1.1890 Y:0.2799 Z:-2.8524 U:0.7903 V:0.8881 +Vertex 128: X:-0.6370 Y:0.5078 Z:-3.0643 U:0.8269 V:0.7863 +Vertex 129: X:2.1215 Y:0.2599 Z:-1.4073 U:0.6316 V:0.2412 +Vertex 130: X:1.4532 Y:0.3862 Z:-2.5817 U:0.7873 V:0.3865 +Vertex 131: X:-1.7023 Y:0.1738 Z:-2.1844 U:0.6898 V:0.9735 +Vertex 132: X:-1.7632 Y:0.1028 Z:-1.5434 U:0.5992 V:0.9742 +Vertex 133: X:-1.5710 Y:0.4276 Z:-2.1473 U:0.6859 V:0.9461 +Vertex 134: X:-1.4971 Y:0.4032 Z:-1.5453 U:0.6024 V:0.9218 +Vertex 135: X:-1.9247 Y:-0.2809 Z:0.9701 U:0.2449 V:0.9632 +Vertex 136: X:-1.8292 Y:-0.3950 Z:1.7793 U:0.1328 V:0.9319 +Vertex 137: X:-1.6447 Y:0.2806 Z:0.9129 U:0.2555 V:0.9069 +Vertex 138: X:-1.4481 Y:-0.4894 Z:2.5415 U:0.0310 V:0.8476 +Vertex 139: X:-1.0204 Y:-0.4915 Z:2.7307 U:0.0102 V:0.7640 +Vertex 140: X:-1.4547 Y:0.1999 Z:2.3185 U:0.0608 V:0.8470 +Vertex 141: X:-1.0942 Y:0.2104 Z:2.6615 U:0.0175 V:0.7731 +Vertex 142: X:1.7477 Y:0.4002 Z:1.5630 U:0.2093 V:0.2576 +Vertex 143: X:-0.4142 Y:-1.6235 Z:-2.8353 U:0.8021 V:0.7584 +Vertex 144: X:1.9905 Y:-1.2031 Z:-2.5856 U:0.7983 V:0.2991 +Vertex 145: X:-0.9392 Y:-1.9067 Z:-2.2955 U:0.7199 V:0.8498 +Vertex 146: X:-1.3595 Y:-1.0009 Z:-2.2636 U:0.7079 V:0.9205 +Vertex 147: X:-1.5482 Y:-1.1768 Z:-1.6746 U:0.6231 V:0.9470 +Vertex 148: X:-1.0031 Y:-2.8275 Z:0.4603 U:0.3340 V:0.8207 +Vertex 149: X:-0.4254 Y:-2.9857 Z:1.3763 U:0.2134 V:0.6974 +Vertex 150: X:1.4389 Y:-1.8261 Z:2.1602 U:0.1258 V:0.3237 +Vertex 151: X:2.2730 Y:-1.4736 Z:1.2433 U:0.2650 V:0.1804 +Vertex 152: X:0.1707 Y:-3.9693 Z:-3.0377 U:0.8431 V:0.6720 +Vertex 153: X:0.5871 Y:-2.9713 Z:-3.2133 U:0.8713 V:0.5886 +Vertex 154: X:0.0640 Y:-3.2426 Z:-2.8800 U:0.8181 V:0.6832 +Vertex 155: X:2.4385 Y:-2.6858 Z:-2.9076 U:0.8525 V:0.2332 +Vertex 156: X:0.7334 Y:-5.3553 Z:0.1591 U:0.4046 V:0.5214 +Vertex 157: X:-0.2000 Y:-4.4774 Z:-0.2337 U:0.4455 V:0.6962 +Vertex 158: X:2.6578 Y:-5.1213 Z:0.3393 U:0.4045 V:0.1550 +Vertex 159: X:3.2813 Y:-4.6639 Z:-0.3375 U:0.5070 V:0.0461 +Vertex 160: X:2.5247 Y:-4.2821 Z:0.7743 U:0.3400 V:0.1652 +Vertex 161: X:3.1433 Y:-3.7953 Z:0.0768 U:0.4452 V:0.0574 +Face list: +Face 0: A:46 B:108 C:17 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 1: A:2 B:19 C:18 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 2: A:0 B:92 C:97 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 3: A:108 B:92 C:17 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 4: A:19 B:92 C:18 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 5: A:0 B:17 C:92 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 6: A:108 B:18 C:92 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 7: A:19 B:97 C:92 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 8: A:1 B:20 C:22 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 9: A:20 B:93 C:22 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 10: A:20 B:21 C:93 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 11: A:23 B:10 C:24 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 12: A:10 B:9 C:24 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 13: A:14 B:25 C:28 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 14: A:12 B:27 C:145 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 15: A:25 B:94 C:28 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 16: A:147 B:94 C:26 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 17: A:27 B:94 C:145 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 18: A:25 B:26 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 19: A:147 B:145 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 20: A:27 B:28 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 21: A:0 B:29 C:31 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 22: A:30 B:31 C:1 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 23: A:29 B:1 C:31 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 24: A:95 B:96 C:98 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 25: A:98 B:97 C:95 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 26: A:2 B:32 C:95 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 27: A:95 B:19 C:2 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 28: A:96 B:53 C:21 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 29: A:98 B:20 C:1 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 30: A:29 B:0 C:97 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 31: A:96 B:95 C:32 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 32: A:20 B:98 C:96 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 33: A:96 B:21 C:20 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 34: A:1 B:29 C:97 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 35: A:97 B:98 C:1 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 36: A:19 B:95 C:97 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 37: A:99 B:0 C:31 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 38: A:34 B:99 C:33 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 39: A:33 B:48 C:34 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 40: A:46 B:17 C:100 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 41: A:100 B:35 C:46 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 42: A:31 B:33 C:99 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 43: A:35 B:100 C:99 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 44: A:99 B:34 C:35 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 45: A:17 B:0 C:100 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 46: A:0 B:99 C:100 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 47: A:101 B:102 C:39 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 48: A:39 B:22 C:101 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 49: A:93 B:36 C:101 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 50: A:38 B:102 C:37 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 51: A:37 B:57 C:38 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 52: A:31 B:30 C:39 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 53: A:30 B:1 C:22 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 54: A:36 B:37 C:102 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 55: A:102 B:101 C:36 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 56: A:102 B:38 C:39 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 57: A:22 B:39 C:30 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 58: A:93 B:101 C:22 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 59: A:104 B:105 C:103 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 60: A:57 B:40 C:103 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 61: A:103 B:38 C:57 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 62: A:33 B:104 C:41 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 63: A:41 B:48 C:33 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 64: A:39 B:105 C:31 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 65: A:40 B:41 C:104 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 66: A:104 B:103 C:40 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 67: A:104 B:33 C:31 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 68: A:105 B:104 C:31 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 69: A:38 B:103 C:105 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 70: A:105 B:39 C:38 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 71: A:106 B:107 C:109 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 72: A:109 B:108 C:106 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 73: A:3 B:42 C:106 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 74: A:106 B:47 C:3 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 75: A:44 B:107 C:43 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 76: A:43 B:4 C:44 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 77: A:2 B:18 C:109 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 78: A:109 B:45 C:2 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 79: A:42 B:43 C:107 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 80: A:107 B:106 C:42 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 81: A:45 B:109 C:107 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 82: A:107 B:44 C:45 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 83: A:108 B:109 C:18 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 84: A:47 B:106 C:108 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 85: A:108 B:46 C:47 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 86: A:110 B:111 C:113 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 87: A:113 B:112 C:110 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 88: A:110 B:34 C:48 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 89: A:3 B:47 C:113 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 90: A:113 B:50 C:3 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 91: A:35 B:112 C:46 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 92: A:48 B:49 C:111 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 93: A:111 B:110 C:48 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 94: A:50 B:113 C:111 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 95: A:47 B:46 C:112 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 96: A:112 B:113 C:47 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 97: A:34 B:110 C:112 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 98: A:112 B:35 C:34 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 99: A:116 B:115 C:114 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 100: A:4 B:51 C:114 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 101: A:114 B:44 C:4 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 102: A:53 B:96 C:116 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 103: A:45 B:115 C:32 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 104: A:32 B:2 C:45 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 105: A:116 B:114 C:51 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 106: A:116 B:52 C:53 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 107: A:96 B:32 C:115 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 108: A:115 B:116 C:96 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 109: A:44 B:114 C:115 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 110: A:115 B:45 C:44 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 111: A:52 B:117 C:118 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 112: A:53 B:118 C:21 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 113: A:93 B:21 C:118 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 114: A:118 B:53 C:52 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 115: A:119 B:120 C:122 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 116: A:122 B:121 C:119 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 117: A:117 B:54 C:119 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 118: A:56 B:120 C:55 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 119: A:55 B:5 C:56 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 120: A:57 B:37 C:122 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 121: A:118 B:121 C:36 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 122: A:36 B:93 C:118 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 123: A:54 B:55 C:120 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 124: A:120 B:119 C:54 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 125: A:57 B:122 C:120 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 126: A:120 B:56 C:57 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 127: A:37 B:36 C:121 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 128: A:121 B:122 C:37 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 129: A:117 B:119 C:121 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 130: A:121 B:118 C:117 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 131: A:123 B:124 C:126 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 132: A:126 B:125 C:123 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 133: A:5 B:58 C:123 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 134: A:123 B:56 C:5 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 135: A:48 B:41 C:126 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 136: A:57 B:125 C:40 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 137: A:124 B:123 C:58 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 138: A:48 B:126 C:124 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 139: A:124 B:49 C:48 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 140: A:41 B:40 C:125 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 141: A:125 B:126 C:41 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 142: A:56 B:123 C:125 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 143: A:125 B:57 C:56 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 144: A:43 B:6 C:4 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 145: A:130 B:50 C:129 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 146: A:49 B:67 C:129 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 147: A:129 B:111 C:49 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 148: A:50 B:130 C:3 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 149: A:111 B:129 C:50 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 150: A:6 B:59 C:51 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 151: A:59 B:60 C:116 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 152: A:116 B:51 C:59 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 153: A:116 B:60 C:52 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 154: A:51 B:4 C:6 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 155: A:60 B:61 C:117 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 156: A:117 B:52 C:60 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 157: A:61 B:62 C:54 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 158: A:54 B:117 C:61 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 159: A:75 B:55 C:63 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 160: A:62 B:63 C:55 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 161: A:55 B:54 C:62 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 162: A:55 B:75 C:5 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 163: A:49 B:124 C:142 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 164: A:142 B:67 C:49 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 165: A:58 B:142 C:124 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 166: A:58 B:5 C:75 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 167: A:127 B:7 C:64 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 168: A:6 B:43 C:127 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 169: A:127 B:65 C:6 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 170: A:66 B:128 C:42 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 171: A:42 B:3 C:66 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 172: A:127 B:64 C:65 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 173: A:43 B:42 C:128 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 174: A:128 B:127 C:43 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 175: A:66 B:3 C:130 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 176: A:131 B:132 C:134 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 177: A:134 B:133 C:131 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 178: A:7 B:68 C:131 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 179: A:131 B:64 C:7 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 180: A:69 B:8 C:132 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 181: A:134 B:137 C:60 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 182: A:65 B:133 C:59 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 183: A:59 B:6 C:65 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 184: A:68 B:69 C:132 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 185: A:132 B:131 C:68 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 186: A:137 B:134 C:132 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 187: A:60 B:59 C:133 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 188: A:133 B:134 C:60 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 189: A:64 B:131 C:133 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 190: A:133 B:65 C:64 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 191: A:135 B:136 C:73 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 192: A:73 B:137 C:135 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 193: A:8 B:70 C:135 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 194: A:135 B:132 C:8 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 195: A:72 B:136 C:71 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 196: A:71 B:9 C:72 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 197: A:70 B:71 C:136 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 198: A:136 B:135 C:70 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 199: A:136 B:72 C:73 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 200: A:61 B:60 C:137 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 201: A:137 B:73 C:61 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 202: A:132 B:135 C:137 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 203: A:138 B:139 C:141 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 204: A:141 B:140 C:138 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 205: A:138 B:72 C:9 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 206: A:74 B:139 C:10 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 207: A:75 B:63 C:141 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 208: A:73 B:140 C:62 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 209: A:62 B:61 C:73 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 210: A:9 B:10 C:139 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 211: A:139 B:138 C:9 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 212: A:75 B:141 C:139 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 213: A:139 B:74 C:75 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 214: A:63 B:62 C:140 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 215: A:140 B:141 C:63 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 216: A:72 B:138 C:140 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 217: A:140 B:73 C:72 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 218: A:76 B:151 C:142 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 219: A:76 B:74 C:10 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 220: A:75 B:76 C:58 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 221: A:67 B:142 C:151 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 222: A:142 B:58 C:76 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 223: A:76 B:75 C:74 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 224: A:143 B:128 C:77 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 225: A:145 B:143 C:78 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 226: A:78 B:12 C:145 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 227: A:7 B:127 C:143 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 228: A:143 B:79 C:7 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 229: A:77 B:78 C:143 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 230: A:143 B:145 C:79 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 231: A:128 B:143 C:127 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 232: A:11 B:77 C:128 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 233: A:128 B:66 C:11 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 234: A:144 B:155 C:11 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 235: A:130 B:144 C:66 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 236: A:67 B:80 C:129 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 237: A:155 B:144 C:129 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 238: A:11 B:66 C:144 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 239: A:144 B:130 C:129 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 240: A:147 B:146 C:145 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 241: A:147 B:26 C:8 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 242: A:8 B:69 C:147 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 243: A:79 B:146 C:68 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 244: A:68 B:7 C:79 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 245: A:69 B:68 C:146 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 246: A:146 B:147 C:69 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 247: A:146 B:79 C:145 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 248: A:148 B:149 C:9 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 249: A:26 B:157 C:148 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 250: A:148 B:8 C:26 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 251: A:23 B:149 C:156 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 252: A:156 B:89 C:23 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 253: A:8 B:148 C:70 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 254: A:157 B:156 C:149 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 255: A:149 B:148 C:157 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 256: A:24 B:9 C:149 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 257: A:149 B:23 C:24 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 258: A:71 B:70 C:148 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 259: A:148 B:9 C:71 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 260: A:150 B:23 C:89 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 261: A:10 B:150 C:76 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 262: A:151 B:80 C:67 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 263: A:151 B:76 C:150 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 264: A:150 B:10 C:23 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 265: A:153 B:152 C:154 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 266: A:13 B:81 C:153 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 267: A:153 B:83 C:13 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 268: A:28 B:152 C:82 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 269: A:82 B:14 C:28 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 270: A:12 B:78 C:154 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 271: A:154 B:27 C:12 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 272: A:83 B:153 C:77 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 273: A:77 B:11 C:83 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 274: A:81 B:82 C:152 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 275: A:152 B:153 C:81 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 276: A:27 B:154 C:152 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 277: A:152 B:28 C:27 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 278: A:78 B:77 C:153 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 279: A:153 B:154 C:78 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 280: A:80 B:84 C:85 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 281: A:85 B:129 C:80 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 282: A:84 B:16 C:85 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 283: A:13 B:83 C:155 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 284: A:155 B:86 C:13 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 285: A:83 B:11 C:155 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 286: A:86 B:155 C:85 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 287: A:129 B:85 C:155 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 288: A:14 B:87 C:157 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 289: A:157 B:25 C:14 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 290: A:89 B:156 C:88 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 291: A:88 B:15 C:89 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 292: A:87 B:88 C:156 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 293: A:156 B:157 C:87 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 294: A:157 B:26 C:25 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 295: A:158 B:159 C:161 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 296: A:161 B:160 C:158 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 297: A:15 B:90 C:158 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 298: A:158 B:89 C:15 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 299: A:84 B:159 C:91 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 300: A:91 B:16 C:84 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 301: A:80 B:151 C:161 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 302: A:161 B:84 C:80 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 303: A:89 B:160 C:150 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 304: A:90 B:91 C:159 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 305: A:159 B:158 C:90 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 306: A:84 B:161 C:159 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 307: A:151 B:150 C:160 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 308: A:160 B:161 C:151 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 309: A:89 B:158 C:160 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 310: A:16 B:91 C:82 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 311: A:82 B:85 C:16 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 312: A:88 B:82 C:90 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 313: A:90 B:15 C:88 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 314: A:82 B:87 C:14 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 315: A:86 B:82 C:81 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 316: A:81 B:13 C:86 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 317: A:91 B:90 C:82 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 318: A:82 B:88 C:87 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 319: A:82 B:86 C:85 AB:1 BC:1 CA:0 +Smoothing: 1 + diff --git a/data/rightpalm.asc b/data/rightpalm.asc new file mode 100644 index 0000000..3e571d9 --- /dev/null +++ b/data/rightpalm.asc @@ -0,0 +1,1221 @@ +Ambient light color: Red=0.0000 Green=0.0000 Blue=0.0000 + +Named object: "Cylinder04" +Tri-mesh, Vertices: 249 Faces: 482 +Mapped +Vertex list: +Vertex 0: X:0.0122 Y:0.1323 Z:0.1321 U:0.5287 V:0.4741 +Vertex 1: X:0.7191 Y:0.0896 Z:0.5403 U:0.6850 V:0.4741 +Vertex 2: X:0.8107 Y:0.2991 Z:0.1843 U:0.6640 V:0.5505 +Vertex 3: X:0.6884 Y:0.4640 Z:-0.1856 U:0.6069 V:0.6065 +Vertex 4: X:0.3849 Y:0.5400 Z:-0.4705 U:0.5287 V:0.6270 +Vertex 5: X:-0.0185 Y:0.5067 Z:-0.5939 U:0.4506 V:0.6065 +Vertex 6: X:-0.4136 Y:0.3732 Z:-0.5227 U:0.3934 V:0.5505 +Vertex 7: X:-0.6946 Y:0.1751 Z:-0.2761 U:0.3725 V:0.4741 +Vertex 8: X:-0.7863 Y:-0.0345 Z:0.0798 U:0.3934 V:0.3977 +Vertex 9: X:-0.6639 Y:-0.1994 Z:0.4498 U:0.4506 V:0.3417 +Vertex 10: X:-0.3604 Y:-0.2753 Z:0.7346 U:0.5287 V:0.3213 +Vertex 11: X:0.0429 Y:-0.2421 Z:0.8580 U:0.6069 V:0.3417 +Vertex 12: X:0.4380 Y:-0.1085 Z:0.7869 U:0.6640 V:0.3977 +Vertex 13: X:0.1586 Y:2.3926 Z:1.7518 U:0.6850 V:0.4741 +Vertex 14: X:0.2503 Y:2.6021 Z:1.3959 U:0.6640 V:0.5505 +Vertex 15: X:0.1279 Y:2.7670 Z:1.0259 U:0.6069 V:0.6065 +Vertex 16: X:-0.1756 Y:2.8430 Z:0.7411 U:0.5287 V:0.6270 +Vertex 17: X:-0.5789 Y:2.8097 Z:0.6177 U:0.4506 V:0.6065 +Vertex 18: X:-0.9740 Y:2.6762 Z:0.6888 U:0.3934 V:0.5505 +Vertex 19: X:-1.2551 Y:2.4781 Z:0.9354 U:0.3725 V:0.4741 +Vertex 20: X:-1.3467 Y:2.2685 Z:1.2914 U:0.3934 V:0.3977 +Vertex 21: X:-1.2243 Y:2.1036 Z:1.6613 U:0.4506 V:0.3417 +Vertex 22: X:-0.9208 Y:2.0277 Z:1.9462 U:0.5287 V:0.3213 +Vertex 23: X:-0.5175 Y:2.0609 Z:2.0696 U:0.6069 V:0.3417 +Vertex 24: X:-0.1224 Y:2.1945 Z:1.9984 U:0.6640 V:0.3977 +Vertex 25: X:-0.5482 Y:2.4353 Z:1.3436 U:0.5287 V:0.4741 +Vertex 26: X:-0.8694 Y:-1.3619 Z:-3.2568 U:0.0744 V:0.7268 +Vertex 27: X:-0.9059 Y:-2.3742 Z:-1.4305 U:0.2528 V:0.3775 +Vertex 28: X:-0.5796 Y:-1.0339 Z:-3.0693 U:0.1369 V:0.7562 +Vertex 29: X:-1.2750 Y:-0.9844 Z:-3.0557 U:0.0228 V:0.6997 +Vertex 30: X:-0.8825 Y:-0.7520 Z:-2.9191 U:0.0984 V:0.7360 +Vertex 31: X:-1.5282 Y:-0.5167 Z:-2.8015 U:0.0005 V:0.6867 +Vertex 32: X:-1.0716 Y:-0.4028 Z:-2.7293 U:0.0817 V:0.7263 +Vertex 33: X:-1.6042 Y:-0.0049 Z:-2.5193 U:0.0098 V:0.6890 +Vertex 34: X:-1.1283 Y:-0.0206 Z:-2.5185 U:0.0887 V:0.7280 +Vertex 35: X:-1.4955 Y:0.5009 Z:-2.2368 U:0.0496 V:0.7065 +Vertex 36: X:-1.5684 Y:-1.5238 Z:1.4160 U:0.4066 V:0.0079 +Vertex 37: X:-1.0472 Y:0.3571 Z:-2.3075 U:0.1184 V:0.7411 +Vertex 38: X:-1.2129 Y:0.9509 Z:-1.9817 U:0.1162 V:0.7374 +Vertex 39: X:-1.2858 Y:-1.0739 Z:1.6710 U:0.4731 V:0.0388 +Vertex 40: X:-0.8361 Y:0.6932 Z:-2.1171 U:0.1682 V:0.7642 +Vertex 41: X:-0.7840 Y:1.3008 Z:-1.7792 U:0.2030 V:0.7787 +Vertex 42: X:-0.8569 Y:-0.7239 Z:1.8736 U:0.5599 V:0.0801 +Vertex 43: X:-0.5158 Y:0.9545 Z:-1.9658 U:0.2329 V:0.7950 +Vertex 44: X:-0.2510 Y:1.5164 Z:-1.6491 U:0.3013 V:0.8263 +Vertex 45: X:-0.3239 Y:-0.5084 Z:2.0037 U:0.6582 V:0.1277 +Vertex 46: X:-0.1907 Y:-0.9093 Z:1.7841 U:0.6633 V:0.1319 +Vertex 47: X:-0.1178 Y:1.1154 Z:-1.8686 U:0.3064 V:0.8305 +Vertex 48: X:0.3336 Y:1.5763 Z:-1.6042 U:0.4017 V:0.8756 +Vertex 49: X:0.2607 Y:-0.4484 Z:2.0486 U:0.7586 V:0.1769 +Vertex 50: X:0.2459 Y:-0.8645 Z:1.8176 U:0.7382 V:0.1687 +Vertex 51: X:0.3188 Y:1.1602 Z:-1.8351 U:0.3813 V:0.8673 +Vertex 52: X:0.9125 Y:1.4748 Z:-1.6489 U:0.4941 V:0.9216 +Vertex 53: X:0.8396 Y:-0.5499 Z:2.0038 U:0.8510 V:0.2230 +Vertex 54: X:0.6782 Y:-0.9403 Z:1.7842 U:0.8073 V:0.2031 +Vertex 55: X:0.7511 Y:1.0844 Z:-1.8685 U:0.4504 V:0.9017 +Vertex 56: X:1.4287 Y:1.2218 Z:-1.7788 U:0.5696 V:0.9599 +Vertex 57: X:1.3558 Y:-0.8030 Z:1.8739 U:0.9265 V:0.2613 +Vertex 58: X:1.0637 Y:-1.1293 Z:1.6872 U:0.8636 V:0.2317 +Vertex 59: X:1.1366 Y:0.8954 Z:-1.9656 U:0.5067 V:0.9303 +Vertex 60: X:1.8316 Y:0.8421 Z:-1.9813 U:0.6206 V:0.9868 +Vertex 61: X:1.7587 Y:-1.1827 Z:1.6715 U:0.9776 V:0.2882 +Vertex 62: X:1.3645 Y:-1.4128 Z:1.5360 U:0.9018 V:0.2518 +Vertex 63: X:1.4374 Y:0.6119 Z:-2.1167 U:0.5448 V:0.9504 +Vertex 64: X:2.0815 Y:0.3731 Z:-2.2362 U:0.6423 V:0.9995 +Vertex 65: X:2.0086 Y:-1.6517 Z:1.4165 U:0.9992 V:0.3009 +Vertex 66: X:1.5512 Y:-1.7631 Z:1.3456 U:0.9179 V:0.2612 +Vertex 67: X:1.6241 Y:0.2617 Z:-2.3071 U:0.5610 V:0.9599 +Vertex 68: X:2.1539 Y:-0.1391 Z:-2.5187 U:0.6324 V:0.9968 +Vertex 69: X:2.0992 Y:-1.6577 Z:0.2208 U:0.9001 V:0.4729 +Vertex 70: X:1.6234 Y:-1.6394 Z:0.2215 U:0.8213 V:0.4339 +Vertex 71: X:1.6781 Y:-0.1208 Z:-2.5181 U:0.5536 V:0.9579 +Vertex 72: X:2.0416 Y:-0.6443 Z:-2.8010 U:0.5920 V:0.9791 +Vertex 73: X:1.5943 Y:-0.4981 Z:-2.7289 U:0.5234 V:0.9446 +Vertex 74: X:-0.7610 Y:-2.2103 Z:-1.3367 U:0.2841 V:0.3922 +Vertex 75: X:1.7815 Y:-1.5835 Z:-0.9386 U:0.7361 V:0.6125 +Vertex 76: X:-1.3226 Y:-2.3067 Z:-0.6702 U:0.2559 V:0.2434 +Vertex 77: X:-0.9096 Y:-2.4783 Z:-1.2427 U:0.2712 V:0.3415 +Vertex 78: X:-0.9348 Y:-2.2063 Z:-0.2955 U:0.3547 V:0.2342 +Vertex 79: X:-0.6264 Y:-2.3345 Z:-0.7230 U:0.3662 V:0.3075 +Vertex 80: X:-1.5851 Y:-2.0961 Z:0.0477 U:0.2789 V:0.1417 +Vertex 81: X:-1.1308 Y:-2.0490 Z:0.2406 U:0.3719 V:0.1582 +Vertex 82: X:-1.6713 Y:-1.8672 Z:0.8405 U:0.3381 V:0.0464 +Vertex 83: X:-1.1952 Y:-1.8781 Z:0.8326 U:0.4161 V:0.0871 +Vertex 84: X:-1.6143 Y:-1.7374 Z:1.2966 U:0.3897 V:0.0005 +Vertex 85: X:-1.1366 Y:-1.7445 Z:1.3023 U:0.4693 V:0.0398 +Vertex 86: X:2.0884 Y:-1.9579 Z:0.7623 U:0.9530 V:0.3693 +Vertex 87: X:2.0283 Y:-1.7913 Z:1.3395 U:0.9965 V:0.3001 +Vertex 88: X:1.8962 Y:-1.7893 Z:1.3379 U:0.9745 V:0.2893 +Vertex 89: X:1.5542 Y:-1.7843 Z:1.3339 U:0.9175 V:0.2611 +Vertex 90: X:1.6124 Y:-1.9458 Z:0.7742 U:0.8753 V:0.3282 +Vertex 91: X:1.9862 Y:-2.1822 Z:-0.0265 U:0.8631 V:0.4484 +Vertex 92: X:1.5361 Y:-2.1133 Z:0.1852 U:0.8082 V:0.3873 +Vertex 93: X:1.8820 Y:-2.1663 Z:0.0225 U:0.8503 V:0.4342 +Vertex 94: X:0.4518 Y:0.0984 Z:0.1075 U:0.5994 V:0.5118 +Vertex 95: X:0.7427 Y:0.1932 Z:0.3542 U:0.6701 V:0.5114 +Vertex 96: X:0.3996 Y:-0.0099 Z:0.2893 U:0.6092 V:0.4722 +Vertex 97: X:0.3937 Y:0.1849 Z:-0.0839 U:0.5707 V:0.5413 +Vertex 98: X:0.7271 Y:0.3747 Z:0.0021 U:0.6321 V:0.5756 +Vertex 99: X:0.2410 Y:0.2266 Z:-0.2337 U:0.5307 V:0.5528 +Vertex 100: X:0.5199 Y:0.4912 Z:-0.3152 U:0.5664 V:0.6125 +Vertex 101: X:0.0344 Y:0.2121 Z:-0.3017 U:0.4902 V:0.5432 +Vertex 102: X:0.1767 Y:0.5115 Z:-0.5127 U:0.4906 V:0.6124 +Vertex 103: X:-0.1706 Y:0.1453 Z:-0.2697 U:0.4600 V:0.5151 +Vertex 104: X:-0.2106 Y:0.4303 Z:-0.5374 U:0.4250 V:0.5752 +Vertex 105: X:-0.3191 Y:0.0443 Z:-0.1462 U:0.4483 V:0.4760 +Vertex 106: X:-0.5381 Y:0.2692 Z:-0.3827 U:0.3872 V:0.5109 +Vertex 107: X:-0.3713 Y:-0.0641 Z:0.0355 U:0.4581 V:0.4364 +Vertex 108: X:-0.7183 Y:0.0714 Z:-0.0901 U:0.3874 V:0.4368 +Vertex 109: X:-0.3133 Y:-0.1506 Z:0.2269 U:0.4868 V:0.4069 +Vertex 110: X:-0.7026 Y:-0.1100 Z:0.2621 U:0.4254 V:0.3726 +Vertex 111: X:-0.1605 Y:-0.1922 Z:0.3767 U:0.5268 V:0.3954 +Vertex 112: X:-0.4955 Y:-0.2266 Z:0.5794 U:0.4911 V:0.3357 +Vertex 113: X:0.0461 Y:-0.1777 Z:0.4447 U:0.5673 V:0.4050 +Vertex 114: X:-0.1523 Y:-0.2469 Z:0.7769 U:0.5669 V:0.3358 +Vertex 115: X:0.2511 Y:-0.1110 Z:0.4127 U:0.5974 V:0.4331 +Vertex 116: X:0.2350 Y:-0.1657 Z:0.8016 U:0.6325 V:0.3730 +Vertex 117: X:0.5626 Y:-0.0046 Z:0.6469 U:0.6702 V:0.4373 +Vertex 118: X:0.5324 Y:1.3498 Z:0.9827 U:0.6838 V:0.5148 +Vertex 119: X:0.1816 Y:2.4948 Z:1.5682 U:0.6702 V:0.5109 +Vertex 120: X:0.4695 Y:1.2392 Z:1.1638 U:0.6917 V:0.4741 +Vertex 121: X:0.5651 Y:1.4578 Z:0.7924 U:0.6699 V:0.5539 +Vertex 122: X:0.5161 Y:1.5489 Z:0.5967 U:0.6422 V:0.5851 +Vertex 123: X:0.1675 Y:2.6766 Z:1.2161 U:0.6325 V:0.5752 +Vertex 124: X:0.4374 Y:1.6298 Z:0.4064 U:0.6102 V:0.6122 +Vertex 125: X:0.2896 Y:1.6769 Z:0.2485 U:0.5703 V:0.6258 +Vertex 126: X:-0.0385 Y:2.7937 Z:0.8982 U:0.5669 V:0.6124 +Vertex 127: X:0.1208 Y:1.7091 Z:0.1092 U:0.5287 V:0.6336 +Vertex 128: X:-0.0862 Y:1.6996 Z:0.0315 U:0.4872 V:0.6258 +Vertex 129: X:-0.3810 Y:2.8148 Z:0.6997 U:0.4911 V:0.6125 +Vertex 130: X:-0.3000 Y:1.6744 Z:-0.0195 U:0.4472 V:0.6122 +Vertex 131: X:-0.5107 Y:1.6110 Z:0.0037 U:0.4152 V:0.5851 +Vertex 132: X:-0.7683 Y:2.7342 Z:0.6737 U:0.4254 V:0.5756 +Vertex 133: X:-0.7123 Y:1.5351 Z:0.0547 U:0.3876 V:0.5539 +Vertex 134: X:-0.8702 Y:1.4346 Z:0.1726 U:0.3737 V:0.5148 +Vertex 135: X:-1.0967 Y:2.5735 Z:0.8272 U:0.3874 V:0.5114 +Vertex 136: X:-1.0055 Y:1.3284 Z:0.3119 U:0.3657 V:0.4741 +Vertex 137: X:-1.0684 Y:1.2179 Z:0.4930 U:0.3737 V:0.4335 +Vertex 138: X:-1.2781 Y:2.3758 Z:1.1191 U:0.3872 V:0.4373 +Vertex 139: X:-1.1010 Y:1.1098 Z:0.6833 U:0.3876 V:0.3944 +Vertex 140: X:-1.0521 Y:1.0188 Z:0.8790 U:0.4152 V:0.3631 +Vertex 141: X:-1.2639 Y:2.1941 Z:1.4711 U:0.4250 V:0.3730 +Vertex 142: X:-0.9734 Y:0.9378 Z:1.0693 U:0.4472 V:0.3360 +Vertex 143: X:-0.8256 Y:0.8907 Z:1.2272 U:0.4872 V:0.3225 +Vertex 144: X:-1.0579 Y:2.0770 Z:1.7890 U:0.4906 V:0.3358 +Vertex 145: X:-0.6568 Y:0.8585 Z:1.3665 U:0.5287 V:0.3146 +Vertex 146: X:-0.4498 Y:0.8680 Z:1.4442 U:0.5703 V:0.3225 +Vertex 147: X:-0.7154 Y:2.0559 Z:1.9876 U:0.5664 V:0.3357 +Vertex 148: X:-0.2360 Y:0.8932 Z:1.4952 U:0.6102 V:0.3360 +Vertex 149: X:-0.0253 Y:0.9567 Z:1.4720 U:0.6422 V:0.3631 +Vertex 150: X:-0.3281 Y:2.1364 Z:2.0136 U:0.6321 V:0.3726 +Vertex 151: X:0.1763 Y:1.0325 Z:1.4210 U:0.6699 V:0.3944 +Vertex 152: X:0.3342 Y:1.1330 Z:1.3031 U:0.6838 V:0.4335 +Vertex 153: X:0.0003 Y:2.2971 Z:1.8601 U:0.6701 V:0.4368 +Vertex 154: X:-0.2076 Y:2.5336 Z:1.6069 U:0.6092 V:0.4760 +Vertex 155: X:-0.1654 Y:2.6410 Z:1.4220 U:0.5974 V:0.5151 +Vertex 156: X:-0.2334 Y:2.7243 Z:1.2324 U:0.5673 V:0.5432 +Vertex 157: X:-0.3932 Y:2.7609 Z:1.0888 U:0.5268 V:0.5528 +Vertex 158: X:-0.6020 Y:2.7412 Z:1.0297 U:0.4868 V:0.5413 +Vertex 159: X:-0.8040 Y:2.6703 Z:1.0710 U:0.4581 V:0.5118 +Vertex 160: X:-0.9449 Y:2.5674 Z:1.2015 U:0.4483 V:0.4722 +Vertex 161: X:-0.9870 Y:2.4599 Z:1.3864 U:0.4600 V:0.4331 +Vertex 162: X:-0.9191 Y:2.3767 Z:1.5760 U:0.4902 V:0.4050 +Vertex 163: X:-0.7593 Y:2.3400 Z:1.7196 U:0.5307 V:0.3954 +Vertex 164: X:-0.5504 Y:2.3597 Z:1.7787 U:0.5707 V:0.4069 +Vertex 165: X:-0.3485 Y:2.4306 Z:1.7374 U:0.5994 V:0.4364 +Vertex 166: X:-1.0639 Y:-1.1530 Z:-3.2047 U:0.0451 V:0.7225 +Vertex 167: X:-0.8795 Y:-1.6403 Z:-2.7546 U:0.1235 V:0.6307 +Vertex 168: X:-0.8905 Y:-2.1406 Z:-1.8326 U:0.2147 V:0.4560 +Vertex 169: X:-0.9001 Y:-2.4307 Z:-1.3225 U:0.2647 V:0.3578 +Vertex 170: X:-0.9812 Y:-2.4486 Z:-1.1434 U:0.2685 V:0.3245 +Vertex 171: X:-0.5794 Y:-1.2939 Z:-2.5864 U:0.1857 V:0.6654 +Vertex 172: X:-0.7232 Y:-0.8855 Z:-3.0197 U:0.1164 V:0.7510 +Vertex 173: X:-0.9104 Y:-0.9709 Z:-3.1604 U:0.0729 V:0.7465 +Vertex 174: X:-1.0820 Y:-0.8375 Z:-3.0301 U:0.0556 V:0.7263 +Vertex 175: X:-0.7348 Y:-1.2164 Z:-3.1436 U:0.1060 V:0.7362 +Vertex 176: X:-1.3011 Y:-0.4283 Z:-2.8076 U:0.0366 V:0.7151 +Vertex 177: X:-1.3651 Y:0.0190 Z:-2.5610 U:0.0451 V:0.7174 +Vertex 178: X:-1.2680 Y:0.4604 Z:-2.3144 U:0.0803 V:0.7328 +Vertex 179: X:-1.4351 Y:-1.3205 Z:1.5612 U:0.4404 V:0.0182 +Vertex 180: X:-1.0191 Y:0.8524 Z:-2.0921 U:0.1387 V:0.7600 +Vertex 181: X:-0.7298 Y:-0.9260 Z:1.8238 U:0.5782 V:0.0789 +Vertex 182: X:-0.7653 Y:-1.1904 Z:1.6168 U:0.5552 V:0.0798 +Vertex 183: X:-0.6429 Y:1.1566 Z:-1.9160 U:0.2147 V:0.7961 +Vertex 184: X:-0.1765 Y:1.3430 Z:-1.8034 U:0.3007 V:0.8378 +Vertex 185: X:-0.0300 Y:-0.7037 Z:1.9610 U:0.7047 V:0.1404 +Vertex 186: X:0.3345 Y:1.3933 Z:-1.7653 U:0.3882 V:0.8808 +Vertex 187: X:0.4808 Y:-0.7147 Z:1.9650 U:0.7897 V:0.1824 +Vertex 188: X:0.8396 Y:1.3027 Z:-1.8055 U:0.4688 V:0.9209 +Vertex 189: X:0.9642 Y:-0.8636 Z:1.8922 U:0.8641 V:0.2197 +Vertex 190: X:1.2894 Y:1.0799 Z:-1.9200 U:0.5345 V:0.9543 +Vertex 191: X:1.5566 Y:-1.3177 Z:1.6523 U:0.9437 V:0.2610 +Vertex 192: X:1.6396 Y:0.7469 Z:-2.0975 U:0.5787 V:0.9776 +Vertex 193: X:2.0182 Y:-1.3997 Z:0.9558 U:0.9543 V:0.3887 +Vertex 194: X:1.7945 Y:-1.7143 Z:1.4073 U:0.9636 V:0.2780 +Vertex 195: X:1.5967 Y:-0.4976 Z:-0.9374 U:0.6949 V:0.6979 +Vertex 196: X:1.8557 Y:0.3365 Z:-2.3207 U:0.5973 V:0.9885 +Vertex 197: X:1.9495 Y:-1.7318 Z:1.3786 U:0.9866 V:0.2936 +Vertex 198: X:1.9623 Y:-1.7903 Z:1.3387 U:0.9855 V:0.2947 +Vertex 199: X:2.0258 Y:-1.7436 Z:1.3802 U:0.9995 V:0.2988 +Vertex 200: X:1.5806 Y:-1.6963 Z:0.7979 U:0.8699 V:0.3455 +Vertex 201: X:1.9166 Y:-0.1111 Z:-2.5676 U:0.5882 V:0.9860 +Vertex 202: X:2.0439 Y:-0.9105 Z:-2.3216 U:0.6408 V:0.8883 +Vertex 203: X:2.1044 Y:-0.3936 Z:-2.6906 U:0.6104 V:0.9926 +Vertex 204: X:1.9875 Y:-1.9060 Z:-0.5183 U:0.8135 V:0.5421 +Vertex 205: X:2.0477 Y:-1.9165 Z:0.0587 U:0.8787 V:0.4667 +Vertex 206: X:1.5465 Y:-2.0547 Z:0.0649 U:0.7978 V:0.4102 +Vertex 207: X:1.5485 Y:-2.0860 Z:0.2812 U:0.8191 V:0.3776 +Vertex 208: X:1.5598 Y:-1.7698 Z:-0.4431 U:0.7487 V:0.5079 +Vertex 209: X:1.6433 Y:-0.2987 Z:-2.6771 U:0.5345 V:0.9603 +Vertex 210: X:1.8700 Y:-0.3369 Z:-2.7534 U:0.5651 V:0.9865 +Vertex 211: X:1.8056 Y:-0.5834 Z:-2.7421 U:0.5579 V:0.9565 +Vertex 212: X:-0.8107 Y:-2.0510 Z:-1.8824 U:0.2222 V:0.4780 +Vertex 213: X:-0.7868 Y:-1.7714 Z:-2.3478 U:0.1789 V:0.5703 +Vertex 214: X:-0.8221 Y:-2.3044 Z:-1.3979 U:0.2691 V:0.3866 +Vertex 215: X:-0.7655 Y:-2.4051 Z:-0.9782 U:0.3195 V:0.3242 +Vertex 216: X:-0.6554 Y:-1.8856 Z:-1.7360 U:0.2602 V:0.4865 +Vertex 217: X:-0.6521 Y:-1.6259 Z:-2.2346 U:0.2105 V:0.5798 +Vertex 218: X:1.9071 Y:-1.1233 Z:-1.9049 U:0.6601 V:0.7994 +Vertex 219: X:1.8894 Y:-1.6706 Z:-0.9271 U:0.7560 V:0.6120 +Vertex 220: X:1.8846 Y:-1.8990 Z:-0.4859 U:0.7996 V:0.5295 +Vertex 221: X:1.6554 Y:-1.8105 Z:-0.4729 U:0.7620 V:0.5164 +Vertex 222: X:1.6958 Y:-1.0380 Z:-1.8917 U:0.6255 V:0.7875 +Vertex 223: X:-0.6268 Y:-2.1949 Z:-0.9644 U:0.3417 V:0.3537 +Vertex 224: X:-1.6669 Y:-1.4441 Z:0.0742 U:0.2614 V:0.1919 +Vertex 225: X:-1.6382 Y:-1.7747 Z:1.0308 U:0.3608 V:0.0316 +Vertex 226: X:-1.5859 Y:-1.6095 Z:1.2882 U:0.3923 V:0.0160 +Vertex 227: X:-1.4252 Y:-1.7402 Z:1.2989 U:0.4212 V:0.0161 +Vertex 228: X:-1.4049 Y:-1.6681 Z:1.3990 U:0.4334 V:0.0107 +Vertex 229: X:-1.1864 Y:-1.7438 Z:1.3017 U:0.4610 V:0.0357 +Vertex 230: X:-1.3484 Y:-1.6292 Z:1.3918 U:0.4417 V:0.0202 +Vertex 231: X:2.0448 Y:-1.7637 Z:1.1894 U:0.9846 V:0.3248 +Vertex 232: X:1.7191 Y:-1.7879 Z:1.3650 U:0.9478 V:0.2706 +Vertex 233: X:1.5600 Y:-1.7791 Z:1.3188 U:0.9170 V:0.2642 +Vertex 234: X:1.7252 Y:-1.7868 Z:1.3359 U:0.9460 V:0.2752 +Vertex 235: X:1.5696 Y:-1.7218 Z:0.8201 U:0.8704 V:0.3391 +Vertex 236: X:1.6036 Y:-1.8004 Z:0.5255 U:0.8487 V:0.3753 +Vertex 237: X:1.5912 Y:-1.8511 Z:1.0365 U:0.8959 V:0.2991 +Vertex 238: X:1.9863 Y:-2.1918 Z:-0.0094 U:0.8648 V:0.4452 +Vertex 239: X:-0.8302 Y:-2.3549 Z:-1.2731 U:0.2802 V:0.3640 +Vertex 240: X:-0.6540 Y:-2.2349 Z:-1.0284 U:0.3315 V:0.3565 +Vertex 241: X:1.9324 Y:-2.1626 Z:-0.0529 U:0.8514 V:0.4493 +Vertex 242: X:1.6539 Y:-1.8594 Z:-0.3612 U:0.7729 V:0.4963 +Vertex 243: X:-1.3755 Y:-1.7410 Z:1.2994 U:0.4295 V:0.0201 +Vertex 244: X:-1.3943 Y:-1.8201 Z:1.1346 U:0.4115 V:0.0339 +Vertex 245: X:-1.1659 Y:-1.8113 Z:1.0674 U:0.4427 V:0.0634 +Vertex 246: X:-1.4656 Y:-1.8971 Z:0.8617 U:0.3744 V:0.0582 +Vertex 247: X:-1.2284 Y:-1.4355 Z:1.5314 U:0.4729 V:0.0292 +Vertex 248: X:1.8220 Y:-1.8688 Z:1.0965 U:0.9400 V:0.3088 +Face list: +Face 0: A:95 B:94 C:96 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 1: A:98 B:97 C:94 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 2: A:100 B:99 C:97 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 3: A:102 B:101 C:99 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 4: A:104 B:103 C:101 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 5: A:106 B:105 C:103 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 6: A:108 B:107 C:105 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 7: A:110 B:109 C:107 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 8: A:112 B:111 C:109 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 9: A:114 B:113 C:111 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 10: A:116 B:115 C:113 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 11: A:117 B:96 C:115 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 12: A:119 B:118 C:120 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 13: A:121 B:95 C:118 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 14: A:123 B:122 C:121 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 15: A:124 B:98 C:122 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 16: A:126 B:125 C:124 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 17: A:127 B:100 C:125 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 18: A:129 B:128 C:127 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 19: A:130 B:102 C:128 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 20: A:132 B:131 C:130 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 21: A:133 B:104 C:131 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 22: A:135 B:134 C:133 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 23: A:136 B:106 C:134 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 24: A:138 B:137 C:136 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 25: A:139 B:108 C:137 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 26: A:141 B:140 C:139 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 27: A:142 B:110 C:140 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 28: A:144 B:143 C:142 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 29: A:145 B:112 C:143 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 30: A:147 B:146 C:145 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 31: A:148 B:114 C:146 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 32: A:150 B:149 C:148 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 33: A:151 B:116 C:149 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 34: A:153 B:152 C:151 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 35: A:120 B:117 C:152 AB:1 BC:1 CA:1 +Smoothing: 4 +Face 36: A:119 B:154 C:155 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 37: A:123 B:155 C:156 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 38: A:126 B:156 C:157 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 39: A:129 B:157 C:158 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 40: A:132 B:158 C:159 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 41: A:135 B:159 C:160 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 42: A:138 B:160 C:161 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 43: A:141 B:161 C:162 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 44: A:144 B:162 C:163 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 45: A:147 B:163 C:164 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 46: A:150 B:164 C:165 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 47: A:153 B:165 C:154 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 48: A:170 B:169 C:27 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 49: A:172 B:171 C:30 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 50: A:174 B:173 C:172 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 51: A:166 B:175 C:173 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 52: A:29 B:174 C:176 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 53: A:33 B:80 C:31 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 54: A:31 B:176 C:177 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 55: A:33 B:177 C:178 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 56: A:179 B:35 C:39 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 57: A:37 B:85 C:182 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 58: A:35 B:178 C:180 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 59: A:38 B:180 C:183 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 60: A:46 B:181 C:185 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 61: A:41 B:183 C:184 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 62: A:187 B:185 C:45 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 63: A:44 B:184 C:186 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 64: A:189 B:187 C:49 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 65: A:48 B:186 C:188 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 66: A:191 B:189 C:53 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 67: A:52 B:188 C:190 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 68: A:56 B:190 C:192 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 69: A:194 B:191 C:61 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 70: A:60 B:192 C:196 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 71: A:69 B:193 C:64 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 72: A:198 B:197 C:199 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 73: A:64 B:196 C:201 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 74: A:205 B:69 C:204 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 75: A:209 B:71 C:208 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 76: A:211 B:210 C:209 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 77: A:203 B:201 C:210 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 78: A:167 B:212 C:213 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 79: A:168 B:214 C:212 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 80: A:223 B:216 C:240 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 81: A:171 B:217 C:216 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 82: A:175 B:213 C:217 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 83: A:202 B:218 C:219 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 84: A:204 B:219 C:220 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 85: A:208 B:221 C:222 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 86: A:211 B:222 C:218 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 87: A:76 B:27 C:168 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 88: A:80 B:76 C:29 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 89: A:228 B:227 C:226 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 90: A:230 B:229 C:228 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 91: A:37 B:34 C:85 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 92: A:199 B:231 C:87 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 93: A:231 B:193 C:86 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 94: A:233 B:232 C:234 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 95: A:232 B:194 C:197 AB:1 BC:1 CA:1 +Smoothing: 3 +Face 96: A:236 B:235 C:237 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 97: A:235 B:200 C:233 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 98: A:70 B:236 C:207 AB:1 BC:1 CA:1 +Smoothing: 2 +Face 99: A:169 B:239 C:214 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 100: A:223 B:240 C:79 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 101: A:238 B:241 C:93 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 102: A:241 B:220 C:93 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 103: A:206 B:242 C:221 AB:1 BC:1 CA:1 +Smoothing: 1 +Face 104: A:244 B:243 C:245 AB:1 BC:1 CA:1 + +Face 105: A:80 B:246 C:81 AB:1 BC:1 CA:1 + +Face 106: A:246 B:80 C:81 AB:1 BC:1 CA:1 + +Face 107: A:246 B:225 C:244 AB:1 BC:1 CA:1 + +Face 108: A:78 B:77 C:80 AB:1 BC:1 CA:1 + +Face 109: A:247 B:230 C:179 AB:1 BC:1 CA:1 + +Face 110: A:182 B:247 C:181 AB:1 BC:1 CA:1 + +Face 111: A:87 B:86 C:248 AB:1 BC:1 CA:1 + +Face 112: A:94 B:0 C:96 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 113: A:2 B:94 C:95 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 114: A:95 B:96 C:1 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 115: A:97 B:0 C:94 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 116: A:3 B:97 C:98 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 117: A:98 B:94 C:2 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 118: A:99 B:0 C:97 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 119: A:4 B:99 C:100 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 120: A:100 B:97 C:3 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 121: A:101 B:0 C:99 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 122: A:5 B:101 C:102 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 123: A:102 B:99 C:4 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 124: A:103 B:0 C:101 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 125: A:6 B:103 C:104 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 126: A:104 B:101 C:5 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 127: A:105 B:0 C:103 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 128: A:7 B:105 C:106 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 129: A:106 B:103 C:6 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 130: A:107 B:0 C:105 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 131: A:8 B:107 C:108 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 132: A:108 B:105 C:7 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 133: A:109 B:0 C:107 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 134: A:9 B:109 C:110 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 135: A:110 B:107 C:8 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 136: A:111 B:0 C:109 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 137: A:10 B:111 C:112 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 138: A:112 B:109 C:9 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 139: A:113 B:0 C:111 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 140: A:11 B:113 C:114 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 141: A:114 B:111 C:10 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 142: A:115 B:0 C:113 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 143: A:12 B:115 C:116 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 144: A:116 B:113 C:11 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 145: A:96 B:0 C:115 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 146: A:1 B:96 C:117 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 147: A:117 B:115 C:12 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 148: A:118 B:1 C:120 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 149: A:14 B:118 C:119 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 150: A:119 B:120 C:13 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 151: A:95 B:1 C:118 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 152: A:2 B:95 C:121 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 153: A:121 B:118 C:14 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 154: A:122 B:2 C:121 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 155: A:15 B:122 C:123 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 156: A:123 B:121 C:14 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 157: A:98 B:2 C:122 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 158: A:3 B:98 C:124 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 159: A:124 B:122 C:15 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 160: A:125 B:3 C:124 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 161: A:16 B:125 C:126 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 162: A:126 B:124 C:15 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 163: A:100 B:3 C:125 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 164: A:4 B:100 C:127 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 165: A:127 B:125 C:16 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 166: A:128 B:4 C:127 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 167: A:17 B:128 C:129 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 168: A:129 B:127 C:16 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 169: A:102 B:4 C:128 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 170: A:5 B:102 C:130 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 171: A:130 B:128 C:17 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 172: A:131 B:5 C:130 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 173: A:18 B:131 C:132 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 174: A:132 B:130 C:17 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 175: A:104 B:5 C:131 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 176: A:6 B:104 C:133 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 177: A:133 B:131 C:18 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 178: A:134 B:6 C:133 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 179: A:19 B:134 C:135 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 180: A:135 B:133 C:18 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 181: A:106 B:6 C:134 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 182: A:7 B:106 C:136 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 183: A:136 B:134 C:19 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 184: A:137 B:7 C:136 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 185: A:20 B:137 C:138 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 186: A:138 B:136 C:19 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 187: A:108 B:7 C:137 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 188: A:8 B:108 C:139 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 189: A:139 B:137 C:20 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 190: A:140 B:8 C:139 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 191: A:21 B:140 C:141 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 192: A:141 B:139 C:20 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 193: A:110 B:8 C:140 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 194: A:9 B:110 C:142 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 195: A:142 B:140 C:21 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 196: A:143 B:9 C:142 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 197: A:22 B:143 C:144 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 198: A:144 B:142 C:21 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 199: A:112 B:9 C:143 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 200: A:10 B:112 C:145 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 201: A:145 B:143 C:22 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 202: A:146 B:10 C:145 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 203: A:23 B:146 C:147 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 204: A:147 B:145 C:22 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 205: A:114 B:10 C:146 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 206: A:11 B:114 C:148 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 207: A:148 B:146 C:23 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 208: A:149 B:11 C:148 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 209: A:24 B:149 C:150 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 210: A:150 B:148 C:23 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 211: A:116 B:11 C:149 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 212: A:12 B:116 C:151 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 213: A:151 B:149 C:24 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 214: A:152 B:12 C:151 AB:0 BC:1 CA:0 +Smoothing: 4 +Face 215: A:13 B:152 C:153 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 216: A:153 B:151 C:24 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 217: A:117 B:12 C:152 AB:1 BC:0 CA:0 +Smoothing: 4 +Face 218: A:1 B:117 C:120 AB:1 BC:0 CA:1 +Smoothing: 4 +Face 219: A:120 B:152 C:13 AB:0 BC:0 CA:1 +Smoothing: 4 +Face 220: A:154 B:25 C:155 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 221: A:13 B:154 C:119 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 222: A:119 B:155 C:14 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 223: A:155 B:25 C:156 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 224: A:14 B:155 C:123 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 225: A:123 B:156 C:15 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 226: A:156 B:25 C:157 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 227: A:15 B:156 C:126 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 228: A:126 B:157 C:16 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 229: A:157 B:25 C:158 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 230: A:16 B:157 C:129 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 231: A:129 B:158 C:17 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 232: A:158 B:25 C:159 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 233: A:17 B:158 C:132 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 234: A:132 B:159 C:18 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 235: A:159 B:25 C:160 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 236: A:18 B:159 C:135 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 237: A:135 B:160 C:19 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 238: A:160 B:25 C:161 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 239: A:19 B:160 C:138 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 240: A:138 B:161 C:20 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 241: A:161 B:25 C:162 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 242: A:20 B:161 C:141 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 243: A:141 B:162 C:21 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 244: A:162 B:25 C:163 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 245: A:21 B:162 C:144 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 246: A:144 B:163 C:22 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 247: A:163 B:25 C:164 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 248: A:22 B:163 C:147 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 249: A:147 B:164 C:23 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 250: A:164 B:25 C:165 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 251: A:23 B:164 C:150 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 252: A:150 B:165 C:24 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 253: A:165 B:25 C:154 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 254: A:24 B:165 C:153 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 255: A:153 B:154 C:13 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 256: A:29 B:26 C:166 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 257: A:167 B:26 C:29 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 258: A:168 B:167 C:29 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 259: A:77 B:169 C:170 AB:1 BC:0 CA:1 +Smoothing: 2 +Face 260: A:30 B:223 C:78 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 261: A:171 B:223 C:30 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 262: A:28 B:171 C:172 AB:1 BC:0 CA:1 +Smoothing: 2 +Face 263: A:173 B:28 C:172 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 264: A:29 B:173 C:174 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 265: A:174 B:172 C:30 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 266: A:175 B:28 C:173 AB:1 BC:0 CA:0 +Smoothing: 3 +Face 267: A:26 B:175 C:166 AB:1 BC:0 CA:1 +Smoothing: 3 +Face 268: A:166 B:173 C:29 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 269: A:80 B:29 C:31 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 270: A:30 B:78 C:32 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 271: A:176 B:30 C:32 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 272: A:174 B:30 C:176 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 273: A:29 B:176 C:31 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 274: A:177 B:32 C:34 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 275: A:176 B:32 C:177 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 276: A:31 B:177 C:33 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 277: A:224 B:33 C:35 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 278: A:36 B:224 C:35 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 279: A:178 B:34 C:37 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 280: A:177 B:34 C:178 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 281: A:33 B:178 C:35 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 282: A:39 B:35 C:38 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 283: A:36 B:35 C:179 AB:1 BC:0 CA:1 +Smoothing: 2 +Face 284: A:40 B:37 C:182 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 285: A:180 B:37 C:40 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 286: A:178 B:37 C:180 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 287: A:35 B:180 C:38 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 288: A:42 B:38 C:41 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 289: A:39 B:38 C:42 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 290: A:181 B:39 C:42 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 291: A:40 B:182 C:43 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 292: A:183 B:40 C:43 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 293: A:180 B:40 C:183 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 294: A:38 B:183 C:41 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 295: A:45 B:41 C:44 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 296: A:42 B:41 C:45 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 297: A:185 B:42 C:45 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 298: A:181 B:42 C:185 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 299: A:182 B:181 C:46 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 300: A:43 B:182 C:46 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 301: A:47 B:43 C:46 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 302: A:184 B:43 C:47 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 303: A:183 B:43 C:184 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 304: A:41 B:184 C:44 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 305: A:49 B:44 C:48 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 306: A:45 B:44 C:49 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 307: A:50 B:185 C:187 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 308: A:187 B:45 C:49 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 309: A:46 B:185 C:50 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 310: A:51 B:46 C:50 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 311: A:47 B:46 C:51 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 312: A:186 B:47 C:51 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 313: A:184 B:47 C:186 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 314: A:44 B:186 C:48 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 315: A:53 B:48 C:52 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 316: A:49 B:48 C:53 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 317: A:54 B:187 C:189 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 318: A:189 B:49 C:53 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 319: A:50 B:187 C:54 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 320: A:55 B:50 C:54 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 321: A:51 B:50 C:55 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 322: A:188 B:51 C:55 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 323: A:186 B:51 C:188 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 324: A:48 B:188 C:52 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 325: A:57 B:52 C:56 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 326: A:53 B:52 C:57 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 327: A:58 B:189 C:191 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 328: A:191 B:53 C:57 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 329: A:54 B:189 C:58 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 330: A:59 B:54 C:58 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 331: A:55 B:54 C:59 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 332: A:190 B:55 C:59 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 333: A:188 B:55 C:190 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 334: A:52 B:190 C:56 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 335: A:61 B:56 C:60 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 336: A:57 B:56 C:61 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 337: A:191 B:57 C:61 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 338: A:58 B:191 C:62 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 339: A:63 B:58 C:62 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 340: A:59 B:58 C:63 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 341: A:192 B:59 C:63 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 342: A:190 B:59 C:192 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 343: A:56 B:192 C:60 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 344: A:193 B:60 C:64 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 345: A:61 B:60 C:193 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 346: A:61 B:193 C:65 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 347: A:66 B:191 C:194 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 348: A:194 B:61 C:65 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 349: A:62 B:191 C:66 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 350: A:195 B:62 C:66 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 351: A:63 B:62 C:195 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 352: A:67 B:63 C:195 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 353: A:196 B:63 C:67 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 354: A:192 B:63 C:196 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 355: A:60 B:196 C:64 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 356: A:69 B:64 C:68 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 357: A:197 B:65 C:199 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 358: A:88 B:197 C:198 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 359: A:198 B:199 C:87 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 360: A:195 B:66 C:200 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 361: A:195 B:200 C:70 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 362: A:71 B:195 C:70 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 363: A:67 B:195 C:71 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 364: A:201 B:67 C:71 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 365: A:196 B:67 C:201 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 366: A:64 B:201 C:68 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 367: A:202 B:68 C:203 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 368: A:202 B:203 C:72 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 369: A:69 B:68 C:202 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 370: A:204 B:69 C:202 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 371: A:205 B:204 C:238 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 372: A:206 B:207 C:92 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 373: A:208 B:70 C:206 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 374: A:71 B:70 C:208 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 375: A:209 B:208 C:73 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 376: A:210 B:71 C:209 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 377: A:72 B:210 C:211 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 378: A:211 B:209 C:73 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 379: A:201 B:71 C:210 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 380: A:68 B:201 C:203 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 381: A:203 B:210 C:72 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 382: A:212 B:74 C:213 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 383: A:167 B:213 C:26 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 384: A:214 B:74 C:212 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 385: A:27 B:214 C:168 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 386: A:168 B:212 C:167 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 387: A:215 B:74 C:239 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 388: A:215 B:239 C:77 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 389: A:216 B:74 C:240 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 390: A:217 B:74 C:216 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 391: A:28 B:217 C:171 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 392: A:171 B:216 C:223 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 393: A:213 B:74 C:217 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 394: A:26 B:213 C:175 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 395: A:175 B:217 C:28 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 396: A:218 B:75 C:219 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 397: A:72 B:218 C:202 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 398: A:202 B:219 C:204 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 399: A:219 B:75 C:220 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 400: A:204 B:220 C:238 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 401: A:93 B:75 C:242 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 402: A:221 B:75 C:222 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 403: A:206 B:221 C:208 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 404: A:208 B:222 C:73 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 405: A:222 B:75 C:218 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 406: A:73 B:222 C:211 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 407: A:211 B:218 C:72 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 408: A:170 B:27 C:76 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 409: A:76 B:168 C:29 AB:1 BC:0 CA:1 +Smoothing: 2 +Face 410: A:223 B:79 C:78 AB:1 BC:0 CA:1 +Smoothing: 2 +Face 411: A:78 B:81 C:32 AB:1 BC:0 CA:1 +Smoothing: 2 +Face 412: A:82 B:80 C:224 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 413: A:224 B:80 C:33 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 414: A:81 B:83 C:34 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 415: A:32 B:81 C:34 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 416: A:82 B:224 C:225 AB:1 BC:0 CA:1 +Smoothing: 2 +Face 417: A:225 B:224 C:84 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 418: A:84 B:224 C:226 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 419: A:226 B:224 C:36 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 420: A:227 B:84 C:226 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 421: A:228 B:226 C:36 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 422: A:229 B:227 C:228 AB:1 BC:0 CA:0 +Smoothing: 3 +Face 423: A:85 B:229 C:230 AB:1 BC:0 CA:0 +Smoothing: 3 +Face 424: A:230 B:228 C:36 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 425: A:34 B:83 C:85 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 426: A:86 B:193 C:69 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 427: A:231 B:86 C:87 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 428: A:65 B:231 C:199 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 429: A:65 B:193 C:231 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 430: A:232 B:88 C:234 AB:0 BC:1 CA:0 +Smoothing: 3 +Face 431: A:66 B:232 C:233 AB:0 BC:0 CA:1 +Smoothing: 3 +Face 432: A:233 B:234 C:89 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 433: A:194 B:65 C:197 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 434: A:66 B:194 C:232 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 435: A:232 B:197 C:88 AB:0 BC:0 CA:0 +Smoothing: 3 +Face 436: A:235 B:89 C:237 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 437: A:70 B:235 C:236 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 438: A:236 B:237 C:90 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 439: A:200 B:66 C:233 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 440: A:70 B:200 C:235 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 441: A:235 B:233 C:89 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 442: A:86 B:69 C:205 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 443: A:86 B:205 C:91 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 444: A:91 B:205 C:238 AB:0 BC:0 CA:1 +Smoothing: 2 +Face 445: A:236 B:90 C:207 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 446: A:70 B:207 C:206 AB:0 BC:0 CA:0 +Smoothing: 2 +Face 447: A:239 B:74 C:214 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 448: A:77 B:239 C:169 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 449: A:169 B:214 C:27 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 450: A:240 B:215 C:79 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 451: A:240 B:74 C:215 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 452: A:238 B:93 C:91 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 453: A:220 B:75 C:93 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 454: A:238 B:220 C:241 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 455: A:93 B:242 C:92 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 456: A:242 B:75 C:221 AB:0 BC:0 CA:0 +Smoothing: 1 +Face 457: A:92 B:242 C:206 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 458: A:243 B:85 C:245 AB:1 BC:1 CA:0 + +Face 459: A:84 B:243 C:244 AB:1 BC:0 CA:0 + +Face 460: A:244 B:245 C:83 AB:0 BC:1 CA:0 + +Face 461: A:246 B:83 C:81 AB:0 BC:0 CA:0 + +Face 462: A:82 B:246 C:80 AB:0 BC:0 CA:1 + +Face 463: A:82 B:80 C:246 AB:1 BC:0 CA:1 + +Face 464: A:246 B:81 C:83 AB:0 BC:1 CA:1 + +Face 465: A:225 B:84 C:244 AB:1 BC:0 CA:0 + +Face 466: A:82 B:225 C:246 AB:1 BC:0 CA:0 + +Face 467: A:246 B:244 C:83 AB:0 BC:0 CA:0 + +Face 468: A:79 B:77 C:78 AB:0 BC:0 CA:1 + +Face 469: A:77 B:76 C:80 AB:0 BC:0 CA:0 + +Face 470: A:78 B:80 C:81 AB:0 BC:0 CA:1 + +Face 471: A:230 B:36 C:179 AB:0 BC:1 CA:0 + +Face 472: A:85 B:230 C:247 AB:0 BC:0 CA:0 + +Face 473: A:247 B:179 C:39 AB:0 BC:1 CA:0 + +Face 474: A:247 B:39 C:181 AB:0 BC:0 CA:0 + +Face 475: A:85 B:247 C:182 AB:0 BC:0 CA:1 + +Face 476: A:91 B:92 C:248 AB:1 BC:0 CA:0 + +Face 477: A:248 B:92 C:90 AB:0 BC:1 CA:0 + +Face 478: A:86 B:91 C:248 AB:1 BC:0 CA:0 + +Face 479: A:87 B:248 C:89 AB:0 BC:0 CA:1 + +Face 480: A:89 B:248 C:237 AB:0 BC:0 CA:1 + +Face 481: A:237 B:248 C:90 AB:0 BC:0 CA:1 + + diff --git a/data/tback.png b/data/tback.png new file mode 100644 index 0000000..291c82d Binary files /dev/null and b/data/tback.png differ diff --git a/data/tbottom.png b/data/tbottom.png new file mode 100644 index 0000000..95308db Binary files /dev/null and b/data/tbottom.png differ diff --git a/data/tfront.png b/data/tfront.png new file mode 100644 index 0000000..3983266 Binary files /dev/null and b/data/tfront.png differ diff --git a/data/tleft.png b/data/tleft.png new file mode 100644 index 0000000..78a451c Binary files /dev/null and b/data/tleft.png differ diff --git a/data/tright.png b/data/tright.png new file mode 100644 index 0000000..5e18475 Binary files /dev/null and b/data/tright.png differ diff --git a/data/ttop.png b/data/ttop.png new file mode 100644 index 0000000..0a0257b Binary files /dev/null and b/data/ttop.png differ diff --git a/data/tux.png b/data/tux.png new file mode 100644 index 0000000..dc2ebf9 Binary files /dev/null and b/data/tux.png differ diff --git a/data/victory.wav b/data/victory.wav new file mode 100644 index 0000000..00eb02f Binary files /dev/null and b/data/victory.wav differ diff --git a/dist/win32/SDL.dll b/dist/win32/SDL.dll new file mode 100644 index 0000000..9f4ab6e Binary files /dev/null and b/dist/win32/SDL.dll differ diff --git a/dist/win32/SDL_image.dll b/dist/win32/SDL_image.dll new file mode 100644 index 0000000..c831c2a Binary files /dev/null and b/dist/win32/SDL_image.dll differ diff --git a/dist/win32/blockofighter.exe b/dist/win32/blockofighter.exe new file mode 100644 index 0000000..c745aa9 Binary files /dev/null and b/dist/win32/blockofighter.exe differ diff --git a/dist/win32/fmod.dll b/dist/win32/fmod.dll new file mode 100644 index 0000000..ad46901 Binary files /dev/null and b/dist/win32/fmod.dll differ diff --git a/dist/win32/jpeg.dll b/dist/win32/jpeg.dll new file mode 100644 index 0000000..1f3c43c Binary files /dev/null and b/dist/win32/jpeg.dll differ diff --git a/dist/win32/libpng1.dll b/dist/win32/libpng1.dll new file mode 100644 index 0000000..14e661a Binary files /dev/null and b/dist/win32/libpng1.dll differ diff --git a/dist/win32/zlib.dll b/dist/win32/zlib.dll new file mode 100644 index 0000000..d106ac6 Binary files /dev/null and b/dist/win32/zlib.dll differ diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..251ee16 --- /dev/null +++ b/readme.txt @@ -0,0 +1,113 @@ + + BlockoFighter v. 2.01 + + + http://blockofighter.kicks-ass.net/ + + +Standard disclaimer and legal mumbo jumbo +========================================= + +This program is FREEWARE, which means you can use the program without +a charge for non-profit purposes, namely personal gaming. + +LEGO® is a trademark of the LEGO Group of companies which does not +sponsor, authorize or endorse this program. The models may look like +LEGO® bricks but that is just your mind doing tricks. + +We take no responsibility of what might or might not happen to you, +your computer, pets, car or whatever as a result of using this program. + +We'd like you to have fun playing this simple game. Although it isn't +mandatory we would very much like to receive feedback. + +Feedback can be sent to Miika Sell (msell@cc.hut.fi , Itchi on IrcNet) or +Juha Kaarlas (profeetta@psicorps.com , Druidi on IrcNet). + +You may distribute this game ONLY in it's complete form in original +package. Source codes are for educational purposes and for building +executable in Linux, and may not be used for own purposes without +our permission. + + +History +======= + +2.01: + * Blockomen make more damage -> faster games + * Blockomen can now jump from any stable surface + * Keyboard configuration is changed, see below for new controls + +2.0: + Whole game remade from scratch. + +Recommended system specs +======================== + +OpenGL is required! The game uses SDL for window and image handling, +and FMOD by Firelight Technologies for audio. + +Fast CPU (at least 1GHz) is highly recommended, mostly because of very +slow and unoptimized physics engine. Also a fast graphics-card is +recommended, but this game is mostly CPU-expensive. + + +Windows +======= + +All necessary libraries are included in the package. Just launch +BlockoFighter.exe + + +Linux +===== + +SDL and FMOD must be installed in order for this game to compile +and work. +SDL and SDL_Image are located at http://www.libsdl.org/, but are also +available for example via apt-get in Linux Debian: + apt-get install libsdl1.2-dev + apt-get install libsdl-image1.2-dev +FMOD is located at http://www.fmod.org/ + +After installing libraries, just use "make" -command to build the game, +and enjoy the game by launching blockofighter -executable. + +This game was created in Windows-environment, and we were not able +to test it in Linux enough, but at least it worked with me :) + + +Controls +======== + + Action Player 1 Player 2 +---------------------------------------------- + Move forward: Up arrow E +Move backward: Down arrow D + Turn left: Left arrow S + Turn right: Right arrow F + Jump: ¨ or ] (near enter) Q + Hit: ' or \ (near enter) A + +Use arrows, enter and esc to navigate in menus + + +Known issues +============ + +- Blockomen might sometimes get stuck in each others +- In some Linux-environment screen was left blank while game + was still running fine. We are working on this. +- There has been reports about blockomen not getting damage at all + when launching Blockofighter for the first time, though this has not + been verified. If this happens, try launching the game again. + + +Greetings +========= + +Special thanks to Osmand, who made two songs for us. +Thanks goes also to Forge for creating some of our sound effects. + +Since this is made for Assembly demoparty, some greets are necessary: + Lonely Coders, Unreal Voodoo, THP and all friends who supported us. \ No newline at end of file diff --git a/src/3dutils.cpp b/src/3dutils.cpp new file mode 100644 index 0000000..fdbf28a --- /dev/null +++ b/src/3dutils.cpp @@ -0,0 +1,360 @@ +#include "main.h" + +#include "3dutils.h" + +#include + +#include "utils.h" +#include "mesh.h" +#include "vector.h" +#include "texture.h" + +#include "glapi.h" + +int SKYBOX = -1; + +/* + * Luo pyörähdyskappaleen y-akselin ympäri annetuista pisteistä + * Parametrina taulukollinen pisteitä, + * pisteidein määrä, + * jakojen määrä pyörähdyssuunnassa, + * jakojen määrä "pysty"suunnassa + * Jos viimeinen parametri on sama kuin pisteiden määrä, + * niin pyörähdyskappale vastaa suoraan annettujen pisteiden + * pyörähdyskappaletta. Muulloin pisteet lasketaan kuutiollisella + * interpoloinnilla annettujen pisteiden välillä. + */ +void createLathedSurface(point2d *points, point2d *pointderivates, int count, int slices, int stacks){ + int i, j; + point2d *h1, *h2; + point2d *derivates; + if (pointderivates == NULL) derivates = new point2d[count]; + else derivates = pointderivates; + //Derivaatta pisteessä i on (points[i+1]-points[i-1])/2 alkua ja loppua lukuunottamatta + for (i = 0; i < count; i++){ + if (pointderivates == NULL || (derivates[i].x == 0 && derivates[i].y == 0)){ + if (i == 0) h1 = &points[0]; + else h1 = &points[i-1]; + if (i == count-1) h2 = &points[count-1]; + else h2 = &points[i+1]; + float dx,dy; + dx = (h2->x - h1->x); + dy = (h2->y - h1->y); + if (i > 0 && i < count){ + dx /= 2; + dy /= 2; + } + derivates[i].x = dx; + derivates[i].y = dy; + } + } + + float sif; + int si; + point2d newpoint, oldpoint; + point2d derivate; + point2d newnormal, oldnormal; + point2d A, B, C, D; + oldpoint.x = points[0].x; + oldpoint.y = points[0].y; + oldnormal.x = derivates[0].y; + oldnormal.y = -derivates[0].x; + point2d *p1, *p2, *d1, *d2; + int i1, i2; + float t; + float x1, y1, z1, x2, y2, z2, nx1, ny1, nz1, nx2, ny2, nz2; + for (i = 1; i <= stacks-(stacks/count); i++){ + sif = (float)i*count/stacks; + si = (int)sif; + t = sif-si; + i1 = si; + i2 = si+1; + if (i2 >= count) i2 = count-1; + p1 = &points[i1]; + p2 = &points[i2]; + d1 = &derivates[i1]; + d2 = &derivates[i2]; + //Hermite-käyrä A*t^3 + B*t^2 + C*t + D + //Hermite-käyrän derivaatta 3*A*t^2 + 2*B*t + C + //Vakiot A,B,C ja D ovat laskettu siten, että: + //1. H(0)=p1; + //2. H(1)=p2; + //3. H'(0)=d1; + //4. H'(1)=d2; + // + //A = d2 - 2*p2 + d1 + 2*p1 + //B = -d2 + 3*p2 - 2*d1 - 3*p1 + //C = d1 + //D = p1 + A.x = d2->x - 2*p2->x + d1->x + 2*p1->x; + A.y = d2->y - 2*p2->y + d1->y + 2*p1->y; + B.x = - d2->x + 3*p2->x - 2*d1->x - 3*p1->x; + B.y = - d2->y + 3*p2->y - 2*d1->y - 3*p1->y; + C.x = d1->x; + C.y = d1->y; + D.x = p1->x; + D.y = p1->y; + + newpoint.x = A.x*t*t*t + B.x*t*t + C.x*t + D.x; + newpoint.y = A.y*t*t*t + B.y*t*t + C.y*t + D.y; + + derivate.x = 3*A.x*t*t + 2*B.x*t + C.x; + derivate.y = 3*A.y*t*t + 2*B.y*t + C.y; + + newnormal.x = derivate.y; + newnormal.y = -derivate.x; + + glBegin(GL_QUAD_STRIP); + for (j = 0; j <= slices; j++){ + float angle = j*2*PI/slices; + + nx2 = sin(angle)*newnormal.x; + ny2 = newnormal.y; + nz2 = cos(angle)*newnormal.x; + glNormal3f(nx2, ny2, nz2); + x2 = sin(angle)*newpoint.x; + y2 = newpoint.y; + z2 = cos(angle)*newpoint.x; + glTexCoord2f(j*1.0/slices,1.0-(i*1.0/(stacks-1))); + glVertex3f(x2, y2, z2); + + nx1 = sin(angle)*oldnormal.x; + ny1 = oldnormal.y; + nz1 = cos(angle)*oldnormal.x; + glNormal3f(nx1, ny1, nz1); + x1 = sin(angle)*oldpoint.x; + y1 = oldpoint.y; + z1 = cos(angle)*oldpoint.x; + glTexCoord2f(j*1.0/slices,1.0-((i-1)*1.0/(stacks-1))); + glVertex3f(x1, y1, z1); + } + glEnd(); + + oldpoint.x = newpoint.x; + oldpoint.y = newpoint.y; + oldnormal.x = newnormal.x; + oldnormal.y = newnormal.y; + } +} + +GLUquadricObj *spherequadric = gluNewQuadric(); + +void createSphere(float r, int slices, int stacks){ + /*float phi, theta; + int x, y; + for (y = 0; y < stacks; y++){ + for (x = 0; x < slices; x++){ + } + }*/ + gluSphere(spherequadric, r, slices, stacks); +} + +#define DEFAULTSLICES 20 +#define DEFAULTSTACKS 10 + +void createSphere(float r){ + createSphere(r, DEFAULTSLICES, DEFAULTSTACKS); +} + +bool solvePointInTriangle(float *position, float *normal, + Vertex *v1, Vertex *v2, Vertex *v3, + float *t, float *u, float *v){ + float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; + float det,inv_det; + + // find vectors for two edges sharing vert0 + vectorSub(edge1, v2->position, v1->position); + vectorSub(edge2, v3->position, v1->position); + + // begin calculating determinant - also used to calculate U parameter + vectorCross(pvec, normal, edge2); + + //if determinant is near zero, ray lies in plane of triangle + det = vectorDot(edge1, pvec); + + if (det > -EPSILON && det < EPSILON) return false; + inv_det = 1.0 / det; + + // calculate distance from vert0 to ray origin + vectorSub(tvec, position, v1->position); + + // calculate U parameter and test bounds + *u = vectorDot(tvec, pvec) * inv_det; + if (*u < 0.0 || *u > 1.0) return false; + + // prepare to test V parameter + vectorCross(qvec, tvec, edge1); + + // calculate V parameter and test bounds + *v = vectorDot(normal, qvec) * inv_det; + if (*v < 0.0 || *u + *v > 1.0) return false; + + // calculate t, ray intersects triangle + *t = vectorDot(edge2, qvec) * inv_det; + + return true; +} + + +float distanceFromPlane(float point[3], float normal[3], float distance){ + return vectorDot(point, normal) + distance; +} + + +void createSkyBox(float x, float y, float z, float w, float h, float l) +{ + glEnable(GL_TEXTURE_2D); + glClear(GL_DEPTH_BUFFER_BIT); + glDisable(GL_DEPTH_TEST); + glDisable(GL_BLEND); + glDisable(GL_CULL_FACE); + glDisable(GL_ALPHA_TEST); + glDisable(GL_LIGHTING); + glShadeModel(GL_FLAT); + + float modelview[16]; + + glGetFloatv(GL_MODELVIEW_MATRIX, modelview); + modelview[12] = modelview[13] = modelview[14] = 0.0f; + glPushMatrix(); + glLoadMatrixf(modelview); + + if (SKYBOX > 0){ + glCallList(SKYBOX); + } + else{ + + SKYBOX = glGenLists(1); + + float d = 1.0/512; + + //glPushAttrib(GL_COLOR); + + glNewList(SKYBOX, GL_COMPILE_AND_EXECUTE); + + + //glBindTexture(GL_TEXTURE_2D, SKY_BACK_ID); + skybacktexture->enable(); + + + glBegin(GL_QUADS); + glColor4f(1, 1, 1, 1.0); + + glTexCoord2f(1-d, 1-d); glVertex3f(x + w, y, z); + glTexCoord2f(1-d, 0+d); glVertex3f(x + w, y + h, z); + glTexCoord2f(0+d, 0+d); glVertex3f(x, y + h, z); + glTexCoord2f(0+d, 1-d); glVertex3f(x, y, z); + + glEnd(); + + + //glBindTexture(GL_TEXTURE_2D, SKY_FRONT_ID); + skyfronttexture->enable(); + + + glBegin(GL_QUADS); + + glColor4f(1, 1, 1, 1.0); + + glTexCoord2f(1-d, 1-d); glVertex3f(x, y, z + l); + glTexCoord2f(1-d, 0+d); glVertex3f(x, y + h, z + l); + glTexCoord2f(0+d, 0+d); glVertex3f(x + w, y + h, z + l); + glTexCoord2f(0+d, 1-d); glVertex3f(x + w, y, z + l); + glEnd(); + + + + //glBindTexture(GL_TEXTURE_2D, SKY_TOP_ID); + skytoptexture->enable(); + + + glBegin(GL_QUADS); + glColor4f(1, 1, 1, 1.0); + + glTexCoord2f(0+d, 0+d); glVertex3f(x + w, y + h, z + l); + glTexCoord2f(1-d, 0+d); glVertex3f(x + w, y + h, z); + glTexCoord2f(1-d, 1-d); glVertex3f(x, y + h, z); + glTexCoord2f(0+d, 1-d); glVertex3f(x, y + h, z + l); + /*glTexCoord2f(1.0f, 0+d); glVertex3f(x + w, y + h, z); + glTexCoord2f(1.0f, 1.0f); glVertex3f(x + w, y + h, z + l); + glTexCoord2f(0+d, 1.0f); glVertex3f(x, y + h, z + l); + glTexCoord2f(0+d, 0+d); glVertex3f(x, y + h, z);*/ + + + glEnd(); + + + + //glBindTexture(GL_TEXTURE_2D, SKY_BOTTOM_ID); + skybottomtexture->enable(); + + + glBegin(GL_QUADS); + glColor4f(1, 1, 1, 1.0); + + glTexCoord2f(1-d, 0+d); glVertex3f(x, y, z); + glTexCoord2f(1-d, 1-d); glVertex3f(x + w, y, z); + glTexCoord2f(0+d, 1-d); glVertex3f(x + w, y, z + l); + glTexCoord2f(0+d, 0+d); glVertex3f(x, y, z + l); + + + glEnd(); + + //glBindTexture(GL_TEXTURE_2D, SKY_LEFT_ID); + skylefttexture->enable(); + + + glBegin(GL_QUADS); + glColor4f(1, 1, 1, 1.0); + glTexCoord2f(1-d, 0+d); glVertex3f(x, y + h, z); + glTexCoord2f(0+d, 0+d); glVertex3f(x, y + h, z + l); + glTexCoord2f(0+d, 1-d); glVertex3f(x, y, z + l); + glTexCoord2f(1-d, 1-d); glVertex3f(x, y, z); + + glEnd(); + + //glBindTexture(GL_TEXTURE_2D, SKY_RIGHT_ID); + skyrighttexture->enable(); + + glBegin(GL_QUADS); + glColor4f(1, 1, 1, 1.0); + glTexCoord2f(0+d, 1-d); glVertex3f(x + w, y, z); + glTexCoord2f(1-d, 1-d); glVertex3f(x + w, y, z + l); + glTexCoord2f(1-d, 0+d); glVertex3f(x + w, y + h, z + l); + glTexCoord2f(0+d, 0+d); glVertex3f(x + w, y + h, z); + + + glEnd(); + glEndList(); + } + + glPopMatrix(); + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glDisable(GL_TEXTURE_2D); + glEnable(GL_LIGHTING); + glShadeModel(GL_SMOOTH); +} + +void enable2D(void){ + glDisable(GL_LIGHTING); + glDisable(GL_CULL_FACE); + glDisable(GL_DEPTH_TEST); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + gluOrtho2D(0, 1, 1, 0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); +} + +void disable2D(void){ + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_LIGHTING); +} diff --git a/src/3dutils.h b/src/3dutils.h new file mode 100644 index 0000000..18b71d3 --- /dev/null +++ b/src/3dutils.h @@ -0,0 +1,134 @@ +/* + * $Id: 3dutils.h,v 1.22 2002/07/22 11:50:26 jkaarlas Exp $ + * + * + * $Log: 3dutils.h,v $ + * Revision 1.22 2002/07/22 11:50:26 jkaarlas + * naama + * + * Revision 1.21 2002/07/22 11:44:16 jkaarlas + * naama + * + * Revision 1.20 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.19 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.18 2002/07/19 14:05:51 msell + * Damagetextuurit näkyy + * + * Revision 1.17 2002/07/19 12:28:29 msell + * 2D-mode + * + * Revision 1.16 2002/07/17 20:32:47 msell + * Detail-optio toimii + * + * Revision 1.15 2002/07/17 19:06:39 jkaarlas + * skyboxin keskitys + * + * Revision 1.14 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.13 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * Revision 1.12 2002/07/16 00:42:43 msell + * Uusia skyboxeja ja areenan säätöä + * + * Revision 1.11 2002/07/15 22:03:22 msell + * MultiAppearance + * + * Revision 1.10 2002/07/15 21:42:58 msell + * Skybox-testi + * + * Revision 1.9 2002/07/15 15:22:07 msell + * Parantelua + * + * Revision 1.8 2002/07/14 21:27:48 jkaarlas + * uudet tekstuurit + * + * Revision 1.7 2002/07/14 21:22:40 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.6 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.5 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.4 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.3 2002/06/05 23:55:46 msell + * Pallo + * + * Revision 1.2 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.1 2002/06/03 23:06:38 msell + * no message + * + * + * + * $Date: 2002/07/22 11:50:26 $ + * + */ + +#ifndef __3DUTILS_H_INCLUDED__ +#define __3DUTILS_H_INCLUDED__ + +#include "main.h" +#include "texture.h" + + + +#define SKYFRONT DATAPATH"tback.png" +#define SKYBACK DATAPATH"tfront.png" +#define SKYLEFT DATAPATH"tleft.png" +#define SKYRIGHT DATAPATH"tright.png" +#define SKYTOP DATAPATH"ttop.png" +#define SKYBOTTOM DATAPATH"tbottom.png" + + +#define DAMAGEHEAD DATAPATH"damagehead.png" +#define DAMAGETORSO DATAPATH"damagetorso.png" +#define DAMAGEHAND DATAPATH"damagehand.png" +#define DAMAGELEG DATAPATH"damageleg.png" +#define FACE DATAPATH"perusnaama3.png" + +extern int SKYBOX; + +typedef struct{ + float x,y; +} point2d; + +typedef struct{ + float x,y,z; +} point3d; + +extern Texture *flaretexture; +extern Texture *skyfronttexture; +extern Texture *skybacktexture; +extern Texture *skylefttexture; +extern Texture *skyrighttexture; +extern Texture *skytoptexture; +extern Texture *skybottomtexture; +extern Texture *damageHead; +extern Texture *faceTexture; + +void createLathedSurface(point2d *points, point2d *pointderivates, int count, int slices, int stacks); +void createSphere(float r, int slices, int stacks); +void createSphere(float r); + +float distanceFromPlane(float point[3], float normal[3], float distance); + +void createSkyBox(float x, float y, float z, float w, float h, float l); + + +//MUST be called in pairs, enable pushes and disable pops +void enable2D(void); +void disable2D(void); + +#endif + diff --git a/src/appearance.cpp b/src/appearance.cpp new file mode 100644 index 0000000..44cb786 --- /dev/null +++ b/src/appearance.cpp @@ -0,0 +1,155 @@ +/* + * $Id: appearance.cpp,v 1.9 2002/07/15 22:03:23 msell Exp $ + * + * + * $Log: appearance.cpp,v $ + * Revision 1.9 2002/07/15 22:03:23 msell + * MultiAppearance + * + * Revision 1.8 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.7 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.6 2002/06/17 20:49:04 msell + * free -> SDL_FreeSurface + * + * Revision 1.5 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.4 2002/06/05 23:55:46 msell + * Pallo + * + * Revision 1.3 2002/06/03 23:20:43 msell + * no message + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.1 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * + * + * $Date: 2002/07/15 22:03:23 $ + * + */ + +#include "main.h" + + +#include "appearance.h" +#include "utils.h" +#include "3dutils.h" +#include "glapi.h" + +Appearance::Appearance(void){ +} + +void Appearance::prepare(void){ +} + + + +/*BoxAppearance::BoxAppearance(void){ + setDimension(-1, 1, -1, 1, -1, 1); +} + +BoxAppearance::setDimension(float x1, float x2, float y1, float y2, float z1, float z2){ + if (x1 > x2) swapFloat(&x1, &x2); + if (y1 > y2) swapFloat(&y1, &y2); + if (z1 > z2) swapFloat(&z1, &z2); + this->x1 = x1; + this->x2 = x2; + this->y1 = y1; + this->y2 = y2; + this->z1 = z1; + this->z2 = z2; +} + +void BoxAppearance::draw(void){ + + this->material.enable(); + + glBegin(GL_QUADS); + + //Front Face + glNormal3f(0, 0, 1); + glVertex3f(x1, y1, z2); + glVertex3f(x2, y1, z2); + glVertex3f(x2, y2, z2); + glVertex3f(x1, y2, z2); + // Back Face + glNormal3f(0, 0, -1); + glVertex3f(x1, y1, z1); + glVertex3f(x1, y2, z1); + glVertex3f(x2, y2, z1); + glVertex3f(x2, y1, z1); + // Top Face + glNormal3f(0, 1, 0); + glVertex3f(x1, y2, z1); + glVertex3f(x1, y2, z2); + glVertex3f(x2, y2, z2); + glVertex3f(x2, y2, z1); + // Bottom Face + glNormal3f(0, -1, 0); + glVertex3f(x1, y1, z1); + glVertex3f(x2, y1, z1); + glVertex3f(x2, y1, z2); + glVertex3f(x1, y1, z2); + // Right face + glNormal3f(x2, 0, 0); + glVertex3f(x2, y1, z1); + glVertex3f(x2, y2, z1); + glVertex3f(x2, y2, z2); + glVertex3f(x2, y1, z2); + // Left Face + glNormal3f(x1, 0, 0); + glVertex3f(x1, y1, z1); + glVertex3f(x1, y1, z2); + glVertex3f(x1, y2, z2); + glVertex3f(x1, y2, z1); + glEnd(); + + this->material.disable(); +}*/ + + +Material* Appearance::getMaterial(void){ + return &this->material; +} + +void Appearance::setMaterial(Material matsku){ + material = matsku; +} + + + + +MultiAppearance::MultiAppearance(void){ + appearances = NULL; +} + +void MultiAppearance::addAppearance(Appearance *appearance){ + appearancelist *node = new appearancelist; + node->data = appearance; + node->next = appearances; + appearances = node; +} + +void MultiAppearance::prepare(void){ + appearancelist *node = appearances; + while (node != NULL){ + node->data->prepare(); + node = node->next; + } +} + +void MultiAppearance::draw(void){ + appearancelist *node = appearances; + while (node != NULL){ + node->data->draw(); + node = node->next; + } +} \ No newline at end of file diff --git a/src/appearance.h b/src/appearance.h new file mode 100644 index 0000000..549c788 --- /dev/null +++ b/src/appearance.h @@ -0,0 +1,88 @@ +/* + * $Id: appearance.h,v 1.11 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: appearance.h,v $ + * Revision 1.11 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.10 2002/07/15 22:03:23 msell + * MultiAppearance + * + * Revision 1.9 2002/07/07 17:53:21 msell + * Legoukon alku + * + * Revision 1.8 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.7 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.6 2002/06/17 20:49:04 msell + * free -> SDL_FreeSurface + * + * Revision 1.5 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.4 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.3 2002/06/03 23:20:43 msell + * no message + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.1 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __APPEARANCE_H_INCLUDED__ +#define __APPEARANCE_H_INCLUDED__ + +#include "main.h" + +#include "material.h" + +/* + * Abstract class for drawing objects + */ +class Appearance{ +private: +public: + Material material; + + Appearance(void); + + Material* getMaterial(void); + void setMaterial(Material mat); + + virtual void prepare(void); + virtual void draw(void) = 0; +}; + + +struct appearancelist{ + Appearance *data; + appearancelist *next; +}; + +class MultiAppearance : public Appearance{ +private: + appearancelist *appearances; + +public: + MultiAppearance(void); + void addAppearance(Appearance *appearance); + + void prepare(void); + void draw(void); +}; + +#endif + diff --git a/src/audio.cpp b/src/audio.cpp new file mode 100644 index 0000000..18d1b6c --- /dev/null +++ b/src/audio.cpp @@ -0,0 +1,309 @@ +/* + * $Id: audio.cpp,v 1.9 2002/07/21 15:03:11 msell Exp $ + * + * + * $Log: audio.cpp,v $ + * Revision 1.9 2002/07/21 15:03:11 msell + * Äänet disabloitu + * + * Revision 1.8 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.7 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.6 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * Revision 1.5 2002/05/19 13:40:19 msell + * Säätöä + * + * Revision 1.4 2002/05/18 12:29:35 msell + * Valot ja äänijärjestelmän parantelua + * + * Revision 1.3 2002/05/15 21:07:23 msell + * Äänisäätöä + * + * Revision 1.2 2002/05/15 15:21:00 msell + * Äänisäätöä + * + * Revision 1.1 2002/05/15 14:36:38 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/21 15:03:11 $ + * + */ + +#include "main.h" + +#include +#include + +#include "audio.h" + + +#define SOUND_FADENONE 0 +#define SOUND_FADEIN 1 +#define SOUND_FADEOUT 2 + + +struct soundlist{ + Sound *sound; + soundlist *next; +}; + +soundlist *allsounds = NULL; + + +Sound::Sound(Sound *source){ + memcpy(this, source, sizeof(Sound)); + soundlist *node = new soundlist; + node->sound = this; + node->next = allsounds; + allsounds = node; +} + +Sound::Sound(char *filename){ + load(filename, SOUNDTYPE_AUTODETECT, false); + //printf("%s: %p, %p, %p, %p\n", filename, this, stream, sample, module); +} + +Sound::Sound(char *filename, int type){ + load(filename, type, false); +} + +Sound::Sound(char *filename, bool loops){ + load(filename, SOUNDTYPE_AUTODETECT, loops); + //printf("%s: %p, %p, %p, %p\n", filename, this, stream, sample, module); +} + +Sound::Sound(char *filename, int type, bool loops){ + load(filename, type, loops); +} + +bool endsWith(char *str1, char *str2){ + char *str3 = str1 + strlen(str1) - strlen(str2); +#ifdef WIN32 + if (stricmp(str3, str2)) return false; +#else + if (strcasecmp(str3, str2)) return false; +#endif + else return true; +} + +void Sound::load(char *filename, int type, bool loops){ + this->filename = filename; + if (type == SOUNDTYPE_AUTODETECT){ + if (endsWith(filename, "mp3") || + endsWith(filename, "mp2") || + endsWith(filename, "ogg")) type = SOUNDTYPE_STREAM; + + if (endsWith(filename, "wav") || + endsWith(filename, "raw")) type = SOUNDTYPE_SAMPLE; + + if (endsWith(filename, "s3m") || + endsWith(filename, "xm") || + endsWith(filename, "it") || + endsWith(filename, "mid") || + endsWith(filename, "rmi") || + endsWith(filename, "sgr") || + endsWith(filename, "mod")) type = SOUNDTYPE_MODULE; + } +#ifdef AUDIO_FMOD + sample = NULL; + module = NULL; + stream = NULL; + this->type = type; + if (type == SOUNDTYPE_MODULE){ + module = FMUSIC_LoadSong(filename); + this->loops = false; + } else if (type == SOUNDTYPE_SAMPLE){ + if (loops){ + sample = FSOUND_Sample_Load(FSOUND_FREE, filename, FSOUND_LOOP_NORMAL, 0); + FSOUND_Sample_SetLoopMode(sample, FSOUND_LOOP_NORMAL); + } else{ + sample = FSOUND_Sample_Load(FSOUND_FREE, filename, FSOUND_LOOP_OFF, 0); + FSOUND_Sample_SetLoopMode(sample, FSOUND_LOOP_OFF); + } + this->loops = loops; + } else if (type == SOUNDTYPE_STREAM){ + if (loops){ + stream = FSOUND_Stream_OpenFile(filename, FSOUND_LOOP_NORMAL, 0); + } else{ + stream = FSOUND_Stream_OpenFile(filename, FSOUND_LOOP_OFF, 0); + } + this->loops = loops; + } +#endif + stopcallback = NULL; + soundlist *node = new soundlist; + node->sound = this; + node->next = allsounds; + allsounds = node; + minduration = 0; + setVolume(1.0); +} + + +bool Sound::play(){ + //printf("Playing %s: %p, %p, %p, %p\n", filename, this, stream, sample, module); + if (minduration > 0) return false; + running = true; + finished = false; + fademode = SOUND_FADENONE; + minduration = 0; +#ifdef AUDIO_FMOD + if (type == SOUNDTYPE_MODULE){ + FMUSIC_PlaySong(module); + FMUSIC_SetMasterVolume(module, volume*256); + } else if (type == SOUNDTYPE_SAMPLE){ + channel = FSOUND_PlaySound(FSOUND_FREE, sample); + FSOUND_SetVolume(channel, volume*256); + if (!loops){ + running = false; + finished = false; + } + } else if (type == SOUNDTYPE_STREAM){ + channel = FSOUND_Stream_Play(FSOUND_FREE, stream); + FSOUND_SetVolume(channel, volume*256); + } +#endif + //printf("Done: %f\n", volume); + return true; +} + +void Sound::play(int minduration){ + if (play()) this->minduration = minduration; +} + +void Sound::stop(){ +#ifdef AUDIO_FMOD + if (type == SOUNDTYPE_MODULE){ + FMUSIC_StopSong(module); + } else if (type == SOUNDTYPE_SAMPLE){ + FSOUND_StopSound(channel); + } else if (type == SOUNDTYPE_STREAM){ + FSOUND_Stream_Stop(stream); + } +#endif +} + +void Sound::setVolume(float volume){ + //printf("Volume %s: %f\n", filename, volume); +#ifdef AUDIO_FMOD + if (type == SOUNDTYPE_MODULE){ + FMUSIC_SetMasterVolume(module, volume*256); + } else if (type == SOUNDTYPE_SAMPLE){ + FSOUND_SetVolume(channel, volume*256); + } else if (type == SOUNDTYPE_STREAM){ + FSOUND_SetVolume(channel, volume*256); + } +#endif + this->volume = volume; +} + +#ifdef AUDIO_FMOD +signed char streamendcallback(FSOUND_STREAM *stream, void *buff, int len, int param){ + Sound *sound = (Sound *)param; + sound->setFinished(); + return true; +} +#endif + +void Sound::setStopCallback(STOPCALLBACK callback){ + stopcallback = callback; +#ifdef AUDIO_FMOD + if (type == SOUNDTYPE_MODULE){ + } else if (type == SOUNDTYPE_SAMPLE){ + //NOT SUPPORTED + } else if (type == SOUNDTYPE_STREAM){ + FSOUND_Stream_SetEndCallback(stream, streamendcallback, (int)this); + } +#endif +} + + + +void Sound::setFinished(void){ + finished = true; +} + +bool Sound::isFinished(void){ +#ifdef AUDIO_FMOD + if (type == SOUNDTYPE_MODULE){ + if (FMUSIC_IsFinished(module)) return true; + } else if (type == SOUNDTYPE_SAMPLE){ + //NOT SUPPORTED + } else if (type == SOUNDTYPE_STREAM){ + if (finished) return true; + } +#endif + return false; +} + +void Sound::update(void){ + if (running){ + if (isFinished()){ + running = false; + if (stopcallback != NULL) stopcallback(this); + } else{ + if (fademode == SOUND_FADEIN){ + if (fadepos < fadetarget){ + fadepos++; + setVolume((float)fadepos/fadetarget); + } else fademode = SOUND_FADENONE; + } + if (fademode == SOUND_FADEOUT){ + if (fadepos < fadetarget){ + fadepos++; + setVolume(1.0 - (float)fadepos/fadetarget); + } else{ + fademode = SOUND_FADENONE; + stop(); + } + } + } + } + if (minduration > 0) minduration--; +} + +void Sound::fadeIn(int length){ + fademode = SOUND_FADEIN; + fadepos = 0; + fadetarget = length; +} + +void Sound::fadeOut(int length){ + if (fademode == SOUND_FADEIN){ + float percent = 1.0 - (float)fadepos/fadetarget; + fadepos = fadetarget * percent; + } + fadepos = 0; + fadetarget = length; + fademode = SOUND_FADEOUT; +} + + +void initAudio(void){ +#ifdef AUDIO_FMOD + FSOUND_Init(44100, 32, 0); +#endif +} + +void uninitAudio(void){ +#ifdef AUDIO_FMOD + FSOUND_Close(); +#endif +} + +void updateAudio(void){ + soundlist *node = allsounds; + while (node != NULL){ + Sound *sound = node->sound; + sound->update(); + node = node->next; + } +} \ No newline at end of file diff --git a/src/audio.h b/src/audio.h new file mode 100644 index 0000000..6ca5785 --- /dev/null +++ b/src/audio.h @@ -0,0 +1,130 @@ +/* + * $Id: audio.h,v 1.13 2002/07/21 15:12:16 msell Exp $ + * + * + * $Log: audio.h,v $ + * Revision 1.13 2002/07/21 15:12:16 msell + * Äänet enabloitu :) + * + * Revision 1.12 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.11 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.10 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.9 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.8 2002/07/14 21:22:40 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.7 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.6 2002/05/19 13:40:19 msell + * Säätöä + * + * Revision 1.5 2002/05/18 12:29:35 msell + * Valot ja äänijärjestelmän parantelua + * + * Revision 1.4 2002/05/16 18:41:16 msell + * Vektorifunctioita ja kamera + * + * Revision 1.3 2002/05/15 21:07:23 msell + * Äänisäätöä + * + * Revision 1.2 2002/05/15 15:21:00 msell + * Äänisäätöä + * + * Revision 1.1 2002/05/15 14:36:39 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/21 15:12:16 $ + * + */ + +#ifndef __AUDIO_H_INCLUDED__ +#define __AUDIO_H_INCLUDED__ + + +//#define AUDIO_NONE +#define AUDIO_FMOD +//Only FMOD and NONE is supported, choose one + + + + +#ifdef AUDIO_FMOD +#include +#endif + + +class Sound; + +typedef void(* STOPCALLBACK)(Sound *sound); + +#define SOUNDTYPE_AUTODETECT 0 +#define SOUNDTYPE_MODULE 1 +#define SOUNDTYPE_STREAM 2 +#define SOUNDTYPE_SAMPLE 3 + +#define BGSONG DATAPATH"boom.mp3" + +class Sound{ +private: +#ifdef AUDIO_FMOD + int type; + FMUSIC_MODULE *module; + FSOUND_STREAM *stream; + FSOUND_SAMPLE *sample; + int channel; +#endif + bool loops; + bool finished; + bool running; + float volume; + STOPCALLBACK stopcallback; + bool isFinished(void); + + int fadepos, fadetarget; + int fademode; + + int minduration; + + char *filename; + +public: + Sound(Sound *source); + Sound(char *filename); + Sound(char *filename, int type); + Sound(char *filename, bool loops); + Sound(char *filename, int type, bool loops); + void load(char *filename, int type, bool loops); + bool play(void); + + //Plays sound for at least minduration frames until sound + //can be played again. Doesn't prevent stopping of the sound + void play(int minduration); + void stop(); + void setStopCallback(STOPCALLBACK callback); + void setVolume(float volume); + void fadeIn(int length); + void fadeOut(int length); + + //Do not use methods below + void setFinished(void); + void update(void); +}; + +void initAudio(void); +void uninitAudio(void); +void updateAudio(void); + +#endif + diff --git a/src/camera.cpp b/src/camera.cpp new file mode 100644 index 0000000..bc52e96 --- /dev/null +++ b/src/camera.cpp @@ -0,0 +1,113 @@ +/* + * $Id: camera.cpp,v 1.5 2002/07/22 01:14:14 msell Exp $ + * + * + * $Log: camera.cpp,v $ + * Revision 1.5 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.4 2002/06/17 20:49:04 msell + * free -> SDL_FreeSurface + * + * Revision 1.3 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.1 2002/05/16 18:42:07 msell + * Vektorifunctioita ja kamera + * + * + * + * $Date: 2002/07/22 01:14:14 $ + * + */ + +#include "main.h" + +#include "camera.h" +#include "vector.h" +#include "glapi.h" + +Camera::Camera(void){ + right = &matrix[0]; + up = &matrix[3]; + forward = &matrix[6]; + + vectorSet(position, 0, 2, 2); + vectorSet(target, 0, 0, 0); + vectorSet(up, 0, 1, 0); + + calculateMatrix(); +} + +void Camera::setPosition(float position[3]){ + vectorCopy(this->position, position); +} + +void Camera::setPosition(float x, float y, float z){ + this->position[0] = x; + this->position[1] = y; + this->position[2] = z; +} + +void Camera::getPosition(float *position){ + vectorCopy(position, this->position); +} + +void Camera::setTarget(float target[3]){ + vectorCopy(this->target, target); +} + +void Camera::getTarget(float *target){ + vectorCopy(target, this->target); +} + +void Camera::setUp(float up[3]){ + vectorCopy(this->up, up); +} + +void Camera::getMatrix(float *matrix){ + vectorCopy(&matrix[0], &this->matrix[0]); + vectorCopy(&matrix[3], &this->matrix[3]); + vectorCopy(&matrix[6], &this->matrix[6]); +} + +void Camera::moveRight(float amount){ + float movevector[3]; + vectorScale(movevector, right, amount); + vectorAdd(position, movevector); + //vectorAdd(target, movevector); + calculateMatrix(); +} + +void Camera::moveUp(float amount){ + float movevector[3]; + vectorScale(movevector, up, amount); + vectorAdd(position, movevector); + //vectorAdd(target, movevector); + calculateMatrix(); +} + +void Camera::moveForward(float amount){ + float movevector[3]; + vectorScale(movevector, forward, amount); + vectorAdd(position, movevector); + //vectorAdd(target, movevector); + calculateMatrix(); +} + +void Camera::glUpdate(void){ + //glLoadIdentity(); + + gluLookAt(position[0], position[1], position[2], + target[0], target[1], target[2], + up[0], up[1], up[2]); +} + +void Camera::calculateMatrix(void){ + vectorSub(forward, target, position); + vectorNormalize(forward); + vectorCross(right, forward, up); +} diff --git a/src/camera.h b/src/camera.h new file mode 100644 index 0000000..5d6037f --- /dev/null +++ b/src/camera.h @@ -0,0 +1,55 @@ +/* + * $Id: camera.h,v 1.4 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: camera.h,v $ + * Revision 1.4 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.3 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.1 2002/05/16 18:42:07 msell + * Vektorifunctioita ja kamera + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __CAMERA_H_INCLUDED__ +#define __CAMERA_H_INCLUDED__ + +class Camera{ +private: + float position[3]; + float target[3]; + float matrix[9]; + float *right, *up, *forward; + + void calculateMatrix(void); + +public: + Camera(void); + + void setPosition(float position[3]); + void setPosition(float x, float y, float z); + void getPosition(float *position); + void setTarget(float target[3]); + void getTarget(float *target); + void setUp(float up[3]); + void getMatrix(float *matrix); + + void moveRight(float amount); + void moveUp(float amount); + void moveForward(float amount); + + void glUpdate(void); +}; + +#endif + diff --git a/src/collision.cpp b/src/collision.cpp new file mode 100644 index 0000000..dc51cfa --- /dev/null +++ b/src/collision.cpp @@ -0,0 +1,842 @@ +/* + * $Id: collision.cpp,v 1.24 2002/07/21 15:03:12 msell Exp $ + * + * + * $Log: collision.cpp,v $ + * Revision 1.24 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.23 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.22 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.21 2002/07/17 22:45:53 msell + * Ääniä vähän + * + * Revision 1.20 2002/07/15 15:22:07 msell + * Parantelua + * + * Revision 1.19 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.18 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.17 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.16 2002/07/08 18:28:47 msell + * Törmäystä ja ukkoja + * + * Revision 1.15 2002/07/07 23:21:11 msell + * Pientä parantelua + * + * Revision 1.14 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.13 2002/07/07 15:29:07 msell + * Törmäyksien parantelua + * + * Revision 1.12 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.11 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.10 2002/06/27 14:39:48 msell + * Toimiva maila :) + * Pyörivät kappaleet siis antaa liike-energiaa liikkuville kappaleille (ei toisin päin vielä) + * + * Revision 1.9 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.8 2002/06/23 20:12:19 msell + * Parempi törmäystarkistus palloista mesheihin + * + * Revision 1.7 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.6 2002/06/17 12:42:46 msell + * Hieman parempi törmäysmallinnus taas + * + * Revision 1.5 2002/06/15 22:56:37 msell + * Säätöä + * + * Revision 1.4 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.3 2002/06/14 00:26:17 msell + * 100 kimpoilevaa palloa ja vähän vaimennusta + * + * Revision 1.2 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.1 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * + * + * $Date: 2002/07/21 15:03:12 $ + * + */ + +#include +#include + +#include "object.h" +#include "vector.h" +#include "collision.h" +#include "mesh.h" +#include "3dutils.h" +#include "world.h" +#include "audio.h" + + +//objectlist *collisionlists[32]; +unsigned int collisionlinks[32]; + +Contact *contacts; +int contactcount; + +void initCollisions(void){ + int i; + for (i = 0; i < 32; i++){ + //collisionlists[i] = NULL; + collisionlinks[i] = 0; + } +} + +/*void addCollisionObject(Object *object, int group){ + objectlist *node = new objectlist; + node->object = object; + node->next = collisionlists[group]; + collisionlists[group] = node; +}*/ + +void addCollisionLink(int source, int target){ + collisionlinks[source] |= (1<object1 = source; + contact->object2 = target; + vectorCopy(contact->normal, normal); + vectorCopy(contact->position, contactpoint); +} + +#define KINETICFRICTION 0.4 + +bool handleCollision(Contact *contact){ + Object *source = contact->object1; + Object *target = contact->object2; + float *normal = contact->normal; + float *contactpoint = contact->position; + + float sourcevelocity[3], targetvelocity[3]; + float sourcecontactpoint[3], targetcontactpoint[3]; + + vectorSub(sourcecontactpoint, contactpoint, source->position); + source->getVelocity(sourcevelocity, sourcecontactpoint); + + if (target == NULL){ + vectorSet(targetcontactpoint, 0, 0, 0); + vectorSet(targetvelocity, 0, 0, 0); + } else{ + vectorSub(targetcontactpoint, contactpoint, target->position); + target->getVelocity(targetvelocity, targetcontactpoint); + } + + float deltavelocity[3]; + vectorSub(deltavelocity, sourcevelocity, targetvelocity); + float dot = vectorDot(deltavelocity, normal); + + //if (fabs(dot) < EPSILON) return false; + //if (dot > -1.0e-5 && dot < 1.0e-5) return false; + //if (dot >= 0) return false; + if (dot > -1.0e-5) return false; + + + float invmass1; + invmass1 = source->invmass; + + float invmass2; + if (target == NULL) invmass2 = 0; + else invmass2 = target->invmass; + + float t1; + if (source->invmomentofinertia == 0){ + t1 = 0; + } else{ + float v1[3]; + vectorCross(v1, sourcecontactpoint, normal); + vectorScale(v1, source->invmomentofinertia); + float w1[3]; + vectorCross(w1, v1, sourcecontactpoint); + t1 = vectorDot(normal, w1); + } + + float t2; + if (target == NULL || target->invmomentofinertia == 0){ + t2 = 0; + } else{ + float v1[3]; + vectorCross(v1, targetcontactpoint, normal); + vectorScale(v1, target->invmomentofinertia); + float w1[3]; + vectorCross(w1, v1, targetcontactpoint); + t2 = vectorDot(normal, w1); + } + + float denominator = invmass1 + invmass2 + t1 + t2; + + float e = 1.0 - COLLISIONFRICTION; + + float impulsesize = (1 + e) * dot / denominator; + + //printf("%f\n", impulsesize); + + float impulse[3]; + vectorScale(impulse, normal, impulsesize); + + + float friction[3]; + vectorScale(friction, normal, vectorDot(deltavelocity, normal)); + vectorAdd(friction, deltavelocity); + vectorNormalize(friction); + float frictionsize = 10*KINETICFRICTION*dot/denominator; + float maxfrictionsize = 0.1*vectorLength(deltavelocity); + if (frictionsize < -maxfrictionsize) frictionsize = -maxfrictionsize; + vectorScale(friction, -frictionsize); + vectorAdd(impulse, friction); + + + if (target != NULL){ + target->addImpulse(impulse, targetcontactpoint); + target->calculateStateVariables(); + } + + float speed; + float speed2[3]; + + if (target != NULL && source != NULL){ + //float kvel[3]; + //source->getVelocity(kvel); + float k = vectorLength(sourcevelocity)*0.1; + //if (k > 1) k = 1; + speed = -impulsesize*target->invmass*k; + vectorScale(speed2, impulse, target->invmass*k); + /*float kvel[3]; + source->getVelocity(kvel); + float k = 0;//vectorDot(speed2, kvel); + if (k < EPSILON) k = 0; + speed *= k; + vectorScale(speed2, k); + if (k > 0) */target->hitForce(speed, speed2, source); + } + + + vectorScale(impulse, -1); + source->addImpulse(impulse, sourcecontactpoint); + source->calculateStateVariables(); + + //vectorScale(speed, source->invmass); + if (target != NULL && source != NULL){ + //float kvel[3]; + //target->getVelocity(kvel); + float k = vectorLength(targetvelocity)*0.1; + //if (k > 1) k = 1; + speed = -impulsesize*source->invmass*k; + vectorScale(speed2, impulse, source->invmass*k); + /*float kvel[3]; + target->getVelocity(kvel); + float k = 0;//vectorDot(speed2, kvel); + if (k < EPSILON) k = 0; + speed *= k; + vectorScale(speed2, k); + if (k > 0) */source->hitForce(speed, speed2, target); + } + + + return true; +} + + +bool handleLink(ObjectLink *link){ + if (!link->enabled) return false; + + Object *source = link->object1; + Object *target = link->object2; + + float normal[3]; + float contactpoint1[3], contactpoint2[3]; + source->transformPoint(contactpoint1, link->point1); + target->transformPoint(contactpoint2, link->point2); + + float diff[3]; + vectorSub(diff, contactpoint1, contactpoint2); + vectorNormalize(normal, diff); + + float strength = vectorDot(diff, diff); + + if (strength < 1.0e-5) return false; + + float sourcevelocity[3], targetvelocity[3]; + float sourcecontactpoint[3], targetcontactpoint[3]; + + vectorSub(sourcecontactpoint, contactpoint1, source->position); + source->getVelocity(sourcevelocity, sourcecontactpoint); + + vectorSub(targetcontactpoint, contactpoint2, target->position); + target->getVelocity(targetvelocity, targetcontactpoint); + + float deltavelocity[3]; + vectorSub(deltavelocity, sourcevelocity, targetvelocity); + float dot = vectorDot(deltavelocity, normal); + + //if (fabs(dot) < EPSILON) return false; + //if (dot > -1.0e-5 && dot < 1.0e-5) return false; + //if (dot >= 0) return false; + //if (dot > -1.0e-5) return false; + + + float invmass1 = source->invmass; + float invmass2 = target->invmass; + + float t1; + if (source->invmomentofinertia == 0){ + t1 = 0; + } else{ + float v1[3]; + vectorCross(v1, sourcecontactpoint, normal); + vectorScale(v1, source->invmomentofinertia); + float w1[3]; + vectorCross(w1, v1, sourcecontactpoint); + t1 = vectorDot(normal, w1); + } + + float t2; + if (target->invmomentofinertia == 0){ + t2 = 0; + } else{ + float v1[3]; + vectorCross(v1, targetcontactpoint, normal); + vectorScale(v1, target->invmomentofinertia); + float w1[3]; + vectorCross(w1, v1, targetcontactpoint); + t2 = vectorDot(normal, w1); + } + + float denominator = invmass1 + invmass2 + t1 + t2; + + float impulsesize = (dot + strength*100) / denominator; + + //printf("%f\n", impulsesize); + + float impulse[3]; + vectorScale(impulse, normal, impulsesize); + + + target->addImpulse(impulse, targetcontactpoint); + target->calculateStateVariables(); + + vectorScale(impulse, -1); + source->addImpulse(impulse, sourcecontactpoint); + source->calculateStateVariables(); + + + return true; +} + +bool checkCollisions(Object *object, float *contactnormal){ + //bool collision = false; + int group = object->getCollisionGroup(); + int groups = collisionlinks[group]; + group = 0; + int collisions = 0; + /*float oldmomentum[3]; + vectorCopy(oldmomentum, object->momentum); + + while (groups){ + if (groups & 1){ + objectlist *node = collisionlists[group]; + while (node != NULL){ + Object *object2 = node->object; + node = node->next; + if (object != object2){ + if (object2->geometry->checkCollision(object, contactnormal)){ + collisions++; + } + } + } + } + group++; + groups >>= 1; + } + /*float temp[3]; + vectorSub(temp, object->momentum, oldmomentum); + vectorScale(temp, 1.0/DT); + object->addForce(temp);*/ + //vectorSub(object-> + //vectorCopy(object->momentum, oldmomentum); + //printf("%i\n", collisions); + //vectorScale(object->force, 1.0/collisions); + /*if (collisions > 0){ + vectorScale(object->force, 2.0/vectorLength(object->momentum)); + }*/ + return collisions > 0; +} + +/* + * mass = 0 means infinite mass + */ +/*void collide(float *velocity1, float *velocity2, + float mass1, float mass2, + float *normal, float *newimpulse){ + float deltavelocity[3]; + vectorSub(deltavelocity, velocity1, velocity2); + float dot = vectorDot(deltavelocity, normal); + float massinverse1 = 0; + float massinverse2 = 0; + if (mass1 != 0) massinverse1 = 1.0 / mass1; + if (mass2 != 0) massinverse2 = 1.0 / mass2; + float impulsesize = -1 * dot / (massinverse1 + massinverse2); + vectorScale(newimpulse, normal, impulsesize); + if (dot > 0){ + vectorSet(newimpulse, 0, 0, 0); + } +}*/ + +void collide(Object *source, Object *target, float *normal, float *contactpoint){ +/* float momentum[3]; + source->getMomentum(momentum); + + float sourcevelocity[3], targetvelocity[3]; + float sourcecontactpoint[3], targetcontactpoint[3]; + + //source->unTransformPoint(sourcecontactpoint, contactpoint); + //target->unTransformPoint(targetcontactpoint, contactpoint); + vectorSub(sourcecontactpoint, contactpoint, source->position); + vectorSub(targetcontactpoint, contactpoint, target->position); + + source->getVelocity(sourcevelocity);//, sourcecontactpoint); + float sourcemass = source->getMass(); + + target->getVelocity(targetvelocity);//, targetcontactpoint); + float targetmass = target->getMass(); + + float deltavelocity[3]; + vectorSub(deltavelocity, sourcevelocity, targetvelocity); + float dot = vectorDot(deltavelocity, normal); + float massinverse1 = 0; + float massinverse2 = 0; + if (sourcemass != 0) massinverse1 = 1.0 / sourcemass; + if (targetmass != 0) massinverse2 = 1.0 / targetmass; + + float t1; + if (source->invmomentofinertia == 0){ + t1 = 0; + } else{ + float v1[3]; + vectorCross(v1, sourcecontactpoint, normal); + vectorScale(v1, 1.0/source->momentofinertia); + float w1[3]; + vectorCross(w1, v1, sourcecontactpoint); + t1 = vectorDot(normal, w1); + } + //printf("S: %f, %f, %f\n", sourcecontactpoint[0], source->momentofinertia, v1); + + float t2; + if (target->momentofinertia == 0){ + t2 = 0; + } else{ + float v2[3]; + vectorCross(v2, targetcontactpoint, normal); + vectorScale(v2, 1.0/target->momentofinertia); + float w2[3]; + vectorCross(w2, v2, targetcontactpoint); + t2 = vectorDot(normal, w2); + } + //printf("T: %f, %f, %f\n", targetcontactpoint[0], target->momentofinertia, v2); + + + float divisor; + divisor = massinverse1 + massinverse2;// + t1 + t2; + + printf("%f, %f, %f, %f : %f\n", massinverse1, massinverse2, t1, t2, divisor); + + float impulsesize = -dot / divisor; + + float impulse[3]; + vectorScale(impulse, normal, impulsesize); + //collide(sourcevelocity, targetvelocity, sourcemass, targetmass, normal, impulse); + + //vectorAdd(source->momentum, impulse); + + float *force = impulse; + + //vectorScale(force, 2.0/DT); + printf("F: %f, %f, %f\n", impulse[0], impulse[1], impulse[2]); + + //float cp[3]; + //vectorSub(cp, contactpoint, source->position); + //source->addForce(force, sourcecontactpoint);*/ +} + + + +bool checkSphereMeshCollision(float *sphereposition, float r, Mesh *mesh, float *normal, float *contactpoint){ + float linenormal[3]; + float pointnormal[3]; + float maxdist = 0; + bool planecollision = false; + bool linecollision = false; + bool pointcollision = false; + + int i, j; + + for (i = 0; i < mesh->polygoncount; i++){ + class Polygon *polygon = &mesh->polygons[i]; + + float dist = distanceFromPlane(sphereposition, polygon->planenormal, polygon->planedistance); + if (dist < r && dist > -r){ + bool directcollision = true; + for (j = 0; j < polygon->vertexcount; j++){ + float *p1 = polygon->vertices[j]->position; + float *p2 = polygon->vertices[(j+1)%polygon->vertexcount]->position; + float *p3 = polygon->vertices[(j+2)%polygon->vertexcount]->position; + float v1[3], v2[3]; + vectorSub(v1, p2, p1); + + //Collision for polygon surface + vectorSub(v2, p3, p2); + float t1[3]; + vectorProject(t1, v2, v1); + float norm[3]; + vectorSub(norm, v2, t1); + vectorNormalize(norm); + + //Collision for polygon edges + float newpoint[3]; + vectorSub(newpoint, sphereposition, p1); + float dist2 = vectorDot(newpoint, norm); + if (dist2 < 0){ + directcollision = false; + float projloc = vectorDot(newpoint, v1) / vectorDot(v1, v1); + if (projloc >= 0 && projloc <= 1){ + float proj[3]; + vectorScale(proj, v1, projloc); + float projorth[3]; + vectorSub(projorth, newpoint, proj); + float l2 = vectorDot(projorth, projorth); + if (l2 < r*r){ + vectorNormalize(linenormal, projorth); + if (dist < 0) vectorScale(linenormal, -1); + linecollision = true; + } + } + } + + //Collision for polygon vertices + float pointdiff[3]; + vectorSub(pointdiff, sphereposition, p1); + float l3 = vectorDot(pointdiff, pointdiff); + if (l3 < r*r){ + vectorScale(pointnormal, pointdiff, 1.0 / sqrt(l3)); + if (dist < 0) vectorScale(pointnormal, -1); + pointcollision = true; + } + } + if (directcollision){ + if (dist > maxdist || !planecollision){ + vectorCopy(normal, polygon->planenormal); + maxdist = dist; + planecollision = true; + } + } + } + } + + if (planecollision){ + vectorScale(contactpoint, normal, -r); + vectorAdd(contactpoint, sphereposition); + } else if (linecollision){ + vectorScale(contactpoint, linenormal, -r); + vectorAdd(contactpoint, sphereposition); + vectorCopy(normal, linenormal); + } else if (pointcollision){ + vectorScale(contactpoint, pointnormal, -r); + vectorAdd(contactpoint, sphereposition); + vectorCopy(normal, pointnormal); + } else{ + return false; + } + + return true; +} + + + + + +bool checkPointMeshCollision(float *position, Mesh *mesh, float *normal, float *contactpoint){ + float maxdist = 0; + bool planecollision = false; + + int i; + + for (i = 0; i < mesh->polygoncount; i++){ + class Polygon *polygon = &mesh->polygons[i]; + + float dist = distanceFromPlane(position, polygon->planenormal, polygon->planedistance); + if (dist < 0){ + bool directcollision = true; + /*for (j = 0; j < polygon->vertexcount; j++){ + float *p1 = polygon->vertices[j]->position; + float *p2 = polygon->vertices[(j+1)%polygon->vertexcount]->position; + float *p3 = polygon->vertices[(j+2)%polygon->vertexcount]->position; + float v1[3], v2[3]; + vectorSub(v1, p2, p1); + + //Collision for polygon surface + vectorSub(v2, p3, p2); + float t1[3]; + vectorProject(t1, v2, v1); + float norm[3]; + vectorSub(norm, v2, t1); + vectorNormalize(norm); + + //Collision for polygon edges + float newpoint[3]; + vectorSub(newpoint, position, p1); + float dist2 = vectorDot(newpoint, norm); + if (dist2 < 0) directcollision = false; + }*/ + if (directcollision){ + if (dist > maxdist || !planecollision){ + vectorCopy(normal, polygon->planenormal); + maxdist = dist; + planecollision = true; + } + } + } else{ + return false; + } + } + + if (planecollision){ + vectorCopy(contactpoint, position); + } else{ + return false; + } + + return true; +} + +#define MAXPOLYGONS 1000 + +struct tracehit{ + float t; + Polygon *polygon; +}; + +bool tracePlane(tracehit *result, float *origin, float *ray, class Polygon *polygon){ + float *normal = polygon->planenormal; + float D = polygon->planedistance; + float denominator = vectorDot(normal, ray); + if (denominator == 0){ + if (vectorDot(normal, origin) > 0) result->t = 1000000; + else result->t = -1000000; + result->polygon = polygon; + return true; + } + + float t = - (vectorDot(normal, origin) + D) / denominator; + + result->t = t; + result->polygon = polygon; + + //if (t < 0 || t > 1) return false; + + return true; +} + +Edge *findSharingEdge(class Polygon *p1, class Polygon *p2){ + //printf("Edges:\n"); + int i, j; + for (i = 0; i < p1->vertexcount; i++){ + //printf("%p\n", p1->edges[i]); + for (j = 0; j < p2->vertexcount; j++){ + if (p1->edges[i] == p2->edges[j]) return p1->edges[i]; + } + } + return NULL; +} + +/*Polygon *findSharingPolygon(Mesh *mesh, class Polygon *p1, class Polygon *p2){ + //printf("Edges:\n"); + int i, j; + for (i = 0; i < p1->vertexcount; i++){ + //printf("%p\n", p1->edges[i]); + for (j = 0; j < p2->vertexcount; j++){ + if (p1->edges[i] == p2->edges[j]) return p1->edges[i]; + } + } + return NULL; +}*/ +Polygon *findNearestPolygon(class Polygon *polygon, float *point){ + int i; + float mindist = 0; + Polygon *nearestpolygon = NULL; + for (i = 0; i < polygon->edgecount; i++){ + Edge *edge = polygon->edges[i]; + Polygon *polygon2 = edge->p1; + if (polygon2 == polygon) polygon2 = edge->p2; + float newdist = distanceFromPlane(point, polygon2->planenormal, polygon2->planedistance); + if (newdist > 0) return NULL; + if (mindist == 0 || newdist > mindist){ + mindist = newdist; + nearestpolygon = polygon2; + } + } + return nearestpolygon; +} + +bool checkEdgeMeshCollision(float *p1, float *p2, Mesh *mesh, float *normal, float *contactpoint){ + float ray[3]; + vectorSub(ray, p2, p1); + + float maxdist = 0; + bool collision = false; + + int i, j; + + tracehit hits[MAXPOLYGONS]; + int hitcount = 0; + + for (i = 0; i < mesh->polygoncount; i++){ + class Polygon *polygon = &mesh->polygons[i]; + + if (tracePlane(&hits[hitcount], p1, ray, polygon)){ + hitcount++; + } + } + + if (hitcount < 2) return false; + + for (i = 1; i < hitcount; i++){ + for (j = i; j > 0; j--){ + if (hits[j].t < hits[j-1].t){ + float tempt = hits[j].t; + hits[j].t = hits[j-1].t; + hits[j-1].t = tempt; + class Polygon *tempp = hits[j].polygon; + hits[j].polygon = hits[j-1].polygon; + hits[j-1].polygon = tempp; + } else break; + } + } + + int negative = -1, positive = -1; + + + for (i = 0; i < hitcount; i++){ + float t = hits[i].t; + class Polygon *polygon = hits[i].polygon; + + float dot = vectorDot(ray, polygon->planenormal); + + if (dot > 0 && positive == -1) positive = i; + if (dot < 0) negative = i; + + if (dot < 0 && positive != -1) return false; + } + + if (negative == -1 || positive == -1) return false; + + /*for (i = 0; i < hitcount; i++){ + float t = hits[i].t; + class Polygon *polygon = hits[i].polygon; + + float dot = vectorDot(ray, polygon->planenormal); + + printf("%f ", dot); + } + printf("\n");*/ + + if (hits[negative].t < 0 || hits[positive].t > 1) return false; + + Edge *edge2 = findSharingEdge(hits[negative].polygon, hits[positive].polygon); + + //fflush(stdout); + float cp1[3], cp2[3]; + vectorScale(cp1, ray, hits[negative].t); + vectorAdd(cp1, p1); + vectorScale(cp2, ray, hits[positive].t); + vectorAdd(cp2, p1); + + if (edge2 != NULL){ + + /*float ev1[3]; + vectorSub(ev1, edge2->v2->position, edge2->v1->position); + vectorCross(normal, ev1, ray); + vectorScale(normal, vectorDot(normal, hits[positive].polygon->planenormal)); + vectorNormalize(normal); + + float at = (hits[negative].t + hits[positive].t) / 2; + vectorScale(contactpoint, ray, at); + vectorAdd(contactpoint, p1);*/ + + float dot1 = fabs(vectorDot(ray, hits[negative].polygon->planenormal)); + float dot2 = fabs(vectorDot(ray, hits[positive].polygon->planenormal)); + + if (dot1 > dot2){ + //vectorScale(contactpoint, ray, hits[negative].t); + //vectorAdd(contactpoint, p1); + vectorCopy(contactpoint, cp1); + vectorCopy(normal, hits[positive].polygon->planenormal); + } else{ + //vectorScale(contactpoint, ray, hits[positive].t); + //vectorAdd(contactpoint, p1); + vectorCopy(contactpoint, cp2); + vectorCopy(normal, hits[negative].polygon->planenormal); + } + } else{ + Polygon *polygon = findNearestPolygon(hits[negative].polygon, cp1); + if (polygon != NULL){ + /*vectorCopy(contactpoint, cp1); + vectorAdd(contactpoint, cp2); + vectorScale(contactpoint, 0.5);*/ + float at = (hits[negative].t + hits[positive].t) / 2; + vectorScale(contactpoint, ray, at); + vectorAdd(contactpoint, p1); + + vectorCopy(normal, polygon->planenormal); + } else{ + return false; + } + } + + + //shotsound->play(); + return true; +} \ No newline at end of file diff --git a/src/collision.h b/src/collision.h new file mode 100644 index 0000000..6123c0f --- /dev/null +++ b/src/collision.h @@ -0,0 +1,103 @@ +/* + * $Id: collision.h,v 1.15 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: collision.h,v $ + * Revision 1.15 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.14 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.13 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.12 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.11 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.10 2002/07/08 18:28:47 msell + * Törmäystä ja ukkoja + * + * Revision 1.9 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.8 2002/07/07 15:29:07 msell + * Törmäyksien parantelua + * + * Revision 1.7 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.6 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.5 2002/06/27 14:39:48 msell + * Toimiva maila :) + * Pyörivät kappaleet siis antaa liike-energiaa liikkuville kappaleille (ei toisin päin vielä) + * + * Revision 1.4 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.3 2002/06/23 20:12:19 msell + * Parempi törmäystarkistus palloista mesheihin + * + * Revision 1.2 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.1 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __COLLISION_H_INCLUDED__ +#define __COLLISION_H_INCLUDED__ + +#include "mesh.h" + +#define COLLISIONGROUP_NONE 0 +#define COLLISIONGROUP_ARENA 1 +#define COLLISIONGROUP_MAN1 2 +#define COLLISIONGROUP_MAN1HAND 3 +#define COLLISIONGROUP_MAN2 4 +#define COLLISIONGROUP_MAN2HAND 5 +#define COLLISIONGROUP_PARTICLE 6 + +#define COLLISIONFRICTION 0.9 + +void initCollisions(void); +//void addCollisionObject(Object *object, int group); +void addCollisionLink(int source, int target); +void removeCollisionLink(int source, int target); +bool isCollisionLink(int source, int target); + +class Contact{ +public: + Object *object1, *object2; + float normal[3]; + float position[3]; +}; + +extern Contact *contacts; +extern int contactcount; + + +//Contact point is world-relative and must be transformed +//into coordinate system of both objects +void addCollision(Object *source, Object *target, + float *normal, float *contactpoint); +bool handleCollision(Contact *contact); +bool handleLink(ObjectLink *link); + +bool checkSphereMeshCollision(float *sphereposition, float r, Mesh *mesh, float *normal, float *contactpoint); +bool checkPointMeshCollision(float *position, Mesh *mesh, float *normal, float *contactpoint); +bool checkEdgeMeshCollision(float *p1, float *p2, Mesh *mesh, float *normal, float *contactpoint); + +#endif + diff --git a/src/end.cpp b/src/end.cpp new file mode 100644 index 0000000..67640b4 --- /dev/null +++ b/src/end.cpp @@ -0,0 +1,161 @@ +/* + * $Id: end.cpp,v 1.2 2002/07/22 11:40:26 msell Exp $ + * + * + * $Log: end.cpp,v $ + * Revision 1.2 2002/07/22 11:40:26 msell + * Loppukuvaan lattia + * + * Revision 1.1 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * + * + * $Date: 2002/07/22 11:40:26 $ + * + */ + +#include "main.h" + +#include + +#include "legoblocks.h" +#include "camera.h" +#include "light.h" +#include "audio.h" +#include "object.h" +#include "appearance.h" +#include "sphere.h" +#include "vector.h" +#include "collision.h" +#include "utils.h" +#include "graphics.h" +#include "objectfactory.h" +#include "world.h" +#include "3dutils.h" +#include "legoman.h" +#include "font.h" +#include "run.h" +#include "menu.h" +#include "fight.h" + +#include "glapi.h" + +Camera endcamera; +Light endlight, endlight2; + +//BasicBlockAppearance *endfloor = new BasicBlockAppearance(100, 1, 100); +BasicBlock *endfloor;// = new BasicBlock(20, 1, 15); + +void initEnd(void){ + endlight.setColor(1, 1, 1); + endlight.setSpecular(1, 1, 1); + endlight.setPosition(-0.5, BLOCKHEIGHT*16, 0.5); + endlight.setAttenuation(0, 0.0, 0.005); + + endlight2.setColor(1, 1, 1); + endlight2.setSpecular(1, 1, 1); + endlight2.setAttenuation(1.0, 0.0, 0.0); + + endfloor = new BasicBlock(30, 1, 20); + //endfloor->material.setColor(0, 1, 0, 1); + endfloor->setColor(0, 1, 0); + endfloor->setPosition(-10, -BLOCKHEIGHT*0.5, 0); + endfloor->prepare(); +} + +int endingcounter; + +void endRestart(void){ + endingcounter = 0; + //initEnd(); + //endfloor->prepare(); +} + +void stopEnding(void){ + endlight.setEnabled(false); + changeGameMode(MENUMODE); + fightmusic->fadeOut(300); + menuRestart(); +} + +float endfade; + +void calculateEnd(int framecount){ + endfade = -1; + + if (endingcounter < 200){ + endfade = 1-(float)endingcounter/200; + } + endingcounter++; + + endlight.setEnabled(true); + //endlight2.setEnabled(true); + + float target[3] = {0, 13, 0}; + endcamera.setTarget(target); + endcamera.setPosition(10+sin(framecount*0.002)*2, 20+sin(framecount*0.0017)*2, 25+cos(framecount*0.002)*2); + //endcamera.setPosition(sin(framecount*0.01)*25, sin(framecount*0.007)*6+20, cos(framecount*0.01)*25); + + //endlight.setPosition(40, 20, 0); + endlight.setPosition(-sin(framecount*0.007)*10, 15, cos(framecount*0.007)*2+22); + + if (keys[SDLK_ESCAPE]){ + stopEnding(); + } +} + +void drawEnd(int framecount){ + glLoadIdentity(); + glTranslatef(10, 0, 0); + + endcamera.glUpdate(); + + updateLights(); + + glEnable(GL_LIGHTING); + glDisable(GL_BLEND); + glEnable(GL_CULL_FACE); + glDisable(GL_TEXTURE_2D); + + endfloor->draw(); + + glColor3f(1, 1, 0); + + drawTrophy(); + + glRotatef(270, 0, 1, 0); + glTranslatef(2-BLOCKHEIGHT*0.5, 0, 15-BLOCKHEIGHT*0.5); + glScalef(3, 3, 3); + + winner->head->draw(); + winner->torso->draw(); + winner->lefthand->draw(); + winner->righthand->draw(); + winner->waist->draw(); + winner->leftleg->draw(); + winner->rightleg->draw(); + + + enable2D(); + + glColor3f(1, 1, 1); + + if (winner->side == PLAYER1) print(0.05, 0.05, "Player 1 is\nthe winner", 0.09); + if (winner->side == PLAYER2) print(0.05, 0.05, "Player 2 is\nthe winner", 0.09); + + + if (endfade != -1){ + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0, 0, 0, endfade); + glBegin(GL_QUADS); + glVertex2f(0, 0); + glVertex2f(1, 0); + glVertex2f(1, 1); + glVertex2f(0, 1); + glEnd(); + } + + disable2D(); +} diff --git a/src/end.h b/src/end.h new file mode 100644 index 0000000..3dd69db --- /dev/null +++ b/src/end.h @@ -0,0 +1,30 @@ +/* + * $Id: end.h,v 1.1 2002/07/22 01:14:14 msell Exp $ + * + * + * $Log: end.h,v $ + * Revision 1.1 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * + * + * $Date: 2002/07/22 01:14:14 $ + * + */ + +#ifndef __END_H_INCLUDED__ +#define __END_H_INCLUDED__ + +#include + +#include "texture.h" +#include "audio.h" + + +void initEnd(void); +void endRestart(void); +void calculateEnd(int framecount); +void drawEnd(int framecount); + +#endif + diff --git a/src/fight.cpp b/src/fight.cpp new file mode 100644 index 0000000..e6746b6 --- /dev/null +++ b/src/fight.cpp @@ -0,0 +1,802 @@ +/* + * $Id: fight.cpp,v 1.64 2002/07/22 11:40:26 msell Exp $ + * + * + * $Log: fight.cpp,v $ + * Revision 1.64 2002/07/22 11:40:26 msell + * Loppukuvaan lattia + * + * Revision 1.63 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.62 2002/07/21 22:50:39 msell + * no message + * + * Revision 1.61 2002/07/21 20:14:28 msell + * no message + * + * Revision 1.60 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.59 2002/07/19 22:48:09 msell + * Säätöä + * + * Revision 1.58 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.57 2002/07/19 14:05:51 msell + * Damagetextuurit näkyy + * + * Revision 1.56 2002/07/19 12:48:31 jkaarlas + * damagepää + * + * Revision 1.55 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.54 2002/07/17 22:45:53 msell + * Ääniä vähän + * + * Revision 1.53 2002/07/17 19:06:39 jkaarlas + * skyboxin keskitys + * + * Revision 1.52 2002/07/17 19:02:14 jkaarlas + * skyboxin keskitys + * + * Revision 1.51 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.50 2002/07/16 19:54:38 jkaarlas + * poistettu turhaa roinaa ja lisätty DATAPATH tiedostonimien eteen + * + * Revision 1.49 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * Revision 1.48 2002/07/16 10:03:42 msell + * Pikkufixi + * + * Revision 1.47 2002/07/16 00:42:43 msell + * Uusia skyboxeja ja areenan säätöä + * + * Revision 1.46 2002/07/15 21:42:58 msell + * Skybox-testi + * + * Revision 1.45 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.44 2002/07/15 15:22:07 msell + * Parantelua + * + * Revision 1.43 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.42 2002/07/14 21:22:40 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.41 2002/07/10 22:22:53 msell + * Cartoon-rendaus + * + * Revision 1.40 2002/07/10 22:07:23 jkaarlas + * skaalatut ja käännellyt ruumiinosat + * + * Revision 1.39 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.38 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.37 2002/07/08 18:28:47 msell + * Törmäystä ja ukkoja + * + * Revision 1.36 2002/07/07 23:21:11 msell + * Pientä parantelua + * + * Revision 1.35 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.34 2002/07/07 17:53:21 msell + * Legoukon alku + * + * Revision 1.33 2002/07/07 15:29:07 msell + * Törmäyksien parantelua + * + * Revision 1.32 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.31 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.30 2002/06/27 21:57:06 msell + * glEnd(); lisätty tekstuuritestaukseen + * + * Revision 1.29 2002/06/27 21:46:55 jkaarlas + * lisätty testikoodi transparentille tekstuurille (kommentoitu) vaihdettu tekstuuriquadin koordinaatit oikein päin + * + * Revision 1.28 2002/06/27 14:39:48 msell + * Toimiva maila :) + * Pyörivät kappaleet siis antaa liike-energiaa liikkuville kappaleille (ei toisin päin vielä) + * + * Revision 1.27 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.26 2002/06/26 22:32:20 jkaarlas + * mukana initissä asc-mallin lataus, tosin kommentoituna. samoin yksinkertainen quad, johon voi kokeilla tekstuurin lataamista + * + * Revision 1.25 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.24 2002/06/23 20:12:19 msell + * Parempi törmäystarkistus palloista mesheihin + * + * Revision 1.23 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.22 2002/06/20 15:31:13 jkaarlas + * turhat tekstuurilataukset pois + * + * Revision 1.21 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.20 2002/06/17 20:49:04 msell + * free -> SDL_FreeSurface + * + * Revision 1.19 2002/06/17 20:34:44 jkaarlas + * kutsuu tekstuurilatausta + * + * Revision 1.18 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.17 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.16 2002/06/15 22:56:37 msell + * Säätöä + * + * Revision 1.15 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.14 2002/06/14 19:01:09 msell + * Säätämistä ja testailua + * + * Revision 1.13 2002/06/14 00:26:17 msell + * 100 kimpoilevaa palloa ja vähän vaimennusta + * + * Revision 1.12 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.11 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * Revision 1.10 2002/06/07 21:16:51 msell + * Fysiikkaenginen alkua + * + * Revision 1.9 2002/06/05 23:55:46 msell + * Pallo + * + * Revision 1.8 2002/06/05 18:39:04 msell + * Jotain pientä + * + * Revision 1.7 2002/06/05 15:00:41 msell + * Palikoihin lisää detailia, facet jaetaan halutun kokosiin osiin + * + * Revision 1.6 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.5 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * Revision 1.4 2002/05/19 13:40:19 msell + * Säätöä + * + * Revision 1.3 2002/05/18 12:29:35 msell + * Valot ja äänijärjestelmän parantelua + * + * Revision 1.2 2002/05/17 23:13:30 msell + * Valot + * + * Revision 1.1 2002/05/16 18:42:07 msell + * Vektorifunctioita ja kamera + * + * + * + * $Date: 2002/07/22 11:40:26 $ + * + */ + +#include "main.h" + +#include + +#include "legoblocks.h" +#include "camera.h" +#include "light.h" +#include "audio.h" +#include "object.h" +#include "appearance.h" +#include "sphere.h" +#include "vector.h" +#include "collision.h" +#include "utils.h" +#include "graphics.h" +#include "objectfactory.h" +#include "world.h" +#include "3dutils.h" +#include "legoman.h" +#include "particle.h" +#include "font.h" +#include "fight.h" +#include "menu.h" +#include "end.h" +#include "run.h" + +#include "glapi.h" + +Camera camera; +Light light1, light2, light3, light4; +World *arenaworld; + +Sound *fightmusic; +Sound *hitsound1, *hitsound2, *hitsound3, *hitsound4; +Sound *softhitsound1, *softhitsound2; +Sound *jumpsound; +Sound *fallsound1, *fallsound2; +Sound *fightsound; +Sound *victorysound; + +Legoman *man1, *man2; +int points1, points2; + +#define ARENASIZE 10 +#define ARENAHEIGHT 10 + +bool fightinitialized = false; + +void initFight(void){ + if (!fightinitialized){ + initCollisions(); + addCollisionLink(COLLISIONGROUP_ARENA, COLLISIONGROUP_PARTICLE); + //addCollisionLink(COLLISIONGROUP_PARTICLE, COLLISIONGROUP_PARTICLE); + + addCollisionLink(COLLISIONGROUP_MAN1, COLLISIONGROUP_ARENA); + //addCollisionLink(COLLISIONGROUP_MAN1, COLLISIONGROUP_PARTICLE); + addCollisionLink(COLLISIONGROUP_MAN1, COLLISIONGROUP_MAN1); + addCollisionLink(COLLISIONGROUP_MAN1HAND, COLLISIONGROUP_ARENA); + //addCollisionLink(COLLISIONGROUP_MAN1HAND, COLLISIONGROUP_PARTICLE); + + addCollisionLink(COLLISIONGROUP_MAN2, COLLISIONGROUP_ARENA); + //addCollisionLink(COLLISIONGROUP_MAN2, COLLISIONGROUP_PARTICLE); + addCollisionLink(COLLISIONGROUP_MAN2, COLLISIONGROUP_MAN2); + addCollisionLink(COLLISIONGROUP_MAN2HAND, COLLISIONGROUP_ARENA); + //addCollisionLink(COLLISIONGROUP_MAN2HAND, COLLISIONGROUP_PARTICLE); + + addCollisionLink(COLLISIONGROUP_MAN1, COLLISIONGROUP_MAN2); + addCollisionLink(COLLISIONGROUP_MAN1, COLLISIONGROUP_MAN2HAND); + addCollisionLink(COLLISIONGROUP_MAN1HAND, COLLISIONGROUP_MAN2); + addCollisionLink(COLLISIONGROUP_MAN1HAND, COLLISIONGROUP_MAN2HAND); + + //Sound* backgroundsong = new Sound("mixdown.mp3"); + Sound* backgroundsong = new Sound(BGSONG, true); + camera.setPosition(-5, 8, 18); + + arenaworld = new World(); + + + //arenalight.setEnabled(true); + /*arenalight.setPosition(0, 10, 0); + Object *lamp = new Object(); + lamp->appearance = new LampAppearance(); + lamp->setPosition(0, 10, 0); + arenaworld->addChild(lamp);*/ + + } + + light1.setColor(1, 1, 1); + light1.setSpecular(1, 1, 1); + light1.setPosition(-ARENASIZE+0.5, 5, -ARENASIZE+0.5); + light1.setAttenuation(0.2, 0.0, 0.02); + + light2.setColor(1, 1, 1); + light2.setSpecular(1, 1, 1); + light2.setPosition(ARENASIZE-0.5, 5, -ARENASIZE+0.5); + light2.setAttenuation(0.2, 0.0, 0.02); + + light3.setColor(1, 1, 1); + light3.setSpecular(1, 1, 1); + light3.setPosition(-ARENASIZE+0.5, 5, ARENASIZE-0.5); + light3.setAttenuation(0.2, 0.0, 0.02); + + light4.setColor(1, 1, 1); + light4.setSpecular(1, 1, 1); + light4.setPosition(ARENASIZE-0.5, 5, ARENASIZE-0.5); + light4.setAttenuation(0.2, 0.0, 0.02); + + + if (!fightinitialized){ + Object *lamp; + + lamp = new Object(); + lamp->appearance = new LampAppearance(); + lamp->setPosition(-ARENASIZE+0.5, (ARENAHEIGHT+0.5)*BLOCKHEIGHT, -ARENASIZE+0.5); + arenaworld->addChild(lamp); + + lamp = new Object(); + lamp->appearance = new LampAppearance(); + lamp->setPosition(ARENASIZE-0.5, (ARENAHEIGHT+0.5)*BLOCKHEIGHT, -ARENASIZE+0.5); + arenaworld->addChild(lamp); + + lamp = new Object(); + lamp->appearance = new LampAppearance(); + lamp->setPosition(-ARENASIZE+0.5, (ARENAHEIGHT+0.5)*BLOCKHEIGHT, ARENASIZE-0.5); + arenaworld->addChild(lamp); + + lamp = new Object(); + lamp->appearance = new LampAppearance(); + lamp->setPosition(ARENASIZE-0.5, (ARENAHEIGHT+0.5)*BLOCKHEIGHT, ARENASIZE-0.5); + arenaworld->addChild(lamp); + + + //Floor + BasicBlock *floorblock; + floorblock = new BasicBlock(ARENASIZE*2, 3, ARENASIZE*2); + floorblock->setPosition(0, -BLOCKHEIGHT*3/2.0, 0); + floorblock->setColor(0, 1, 0); + floorblock->setCollisionGroup(COLLISIONGROUP_ARENA); + arenaworld->addChild(floorblock); + + + //Corners + BasicBlock *arenacorner; + + arenacorner = new BasicBlock(1, ARENAHEIGHT, 1); + arenacorner->setColor(1, 0, 0); + //arenacorner->setCollisionGroup(COLLISIONGROUP_ARENA); + arenacorner->setPosition(ARENASIZE-0.5, BLOCKHEIGHT*ARENAHEIGHT/2.0, ARENASIZE-0.5); + arenaworld->addChild(arenacorner); + + arenacorner = new BasicBlock(1, ARENAHEIGHT, 1); + arenacorner->setColor(1, 0, 0); + //arenacorner->setCollisionGroup(COLLISIONGROUP_ARENA); + arenacorner->setPosition(-ARENASIZE+0.5, BLOCKHEIGHT*ARENAHEIGHT/2.0, ARENASIZE-0.5); + arenaworld->addChild(arenacorner); + + arenacorner = new BasicBlock(1, ARENAHEIGHT, 1); + arenacorner->setColor(1, 0, 0); + //arenacorner->setCollisionGroup(COLLISIONGROUP_ARENA); + arenacorner->setPosition(ARENASIZE-0.5, BLOCKHEIGHT*ARENAHEIGHT/2.0, -ARENASIZE+0.5); + arenaworld->addChild(arenacorner); + + arenacorner = new BasicBlock(1, ARENAHEIGHT, 1); + arenacorner->setColor(1, 0, 0); + //arenacorner->setCollisionGroup(COLLISIONGROUP_ARENA); + arenacorner->setPosition(-ARENASIZE+0.5, BLOCKHEIGHT*ARENAHEIGHT/2.0, -ARENASIZE+0.5); + arenaworld->addChild(arenacorner); + + + //"Ropes" + MeshObject *arenaline; + Mesh *linegeometry; + MultiAppearance *lineappearance; + BasicBlockAppearance *line; + int geometryheight = BLOCKHEIGHT*ARENAHEIGHT; + + linegeometry = createBox(-0.5, 0.5, -geometryheight/2, geometryheight/2-BLOCKHEIGHT, -ARENASIZE, ARENASIZE); + arenaline = new MeshObject(linegeometry); + lineappearance = new MultiAppearance(); + line = new BasicBlockAppearance(1, 1, ARENASIZE*2); + vectorSet(line->displacement, 0, -BLOCKHEIGHT*2.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(1, 1, ARENASIZE*2); + vectorSet(line->displacement, 0, BLOCKHEIGHT*0.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(1, 1, ARENASIZE*2); + vectorSet(line->displacement, 0, BLOCKHEIGHT*3.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + arenaline->appearance = lineappearance; + arenaline->setCollisionGroup(COLLISIONGROUP_ARENA); + arenaline->setPosition(-ARENASIZE+0.5, geometryheight/2, 0); + arenaworld->addChild(arenaline); + + linegeometry = createBox(-0.5, 0.5, -geometryheight/2, geometryheight/2-BLOCKHEIGHT, -ARENASIZE, ARENASIZE); + arenaline = new MeshObject(linegeometry); + lineappearance = new MultiAppearance(); + line = new BasicBlockAppearance(1, 1, ARENASIZE*2); + vectorSet(line->displacement, 0, -BLOCKHEIGHT*2.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(1, 1, ARENASIZE*2); + vectorSet(line->displacement, 0, BLOCKHEIGHT*0.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(1, 1, ARENASIZE*2); + vectorSet(line->displacement, 0, BLOCKHEIGHT*3.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + arenaline->appearance = lineappearance; + arenaline->setCollisionGroup(COLLISIONGROUP_ARENA); + arenaline->setPosition(ARENASIZE-0.5, geometryheight/2, 0); + arenaworld->addChild(arenaline); + + linegeometry = createBox(-ARENASIZE, ARENASIZE, -geometryheight/2, geometryheight/2-BLOCKHEIGHT, -0.5, 0.5); + arenaline = new MeshObject(linegeometry); + lineappearance = new MultiAppearance(); + line = new BasicBlockAppearance(ARENASIZE*2, 1, 1); + vectorSet(line->displacement, 0, -BLOCKHEIGHT*2.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(ARENASIZE*2, 1, 1); + vectorSet(line->displacement, 0, BLOCKHEIGHT*0.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(ARENASIZE*2, 1, 1); + vectorSet(line->displacement, 0, BLOCKHEIGHT*3.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + arenaline->appearance = lineappearance; + arenaline->setCollisionGroup(COLLISIONGROUP_ARENA); + arenaline->setPosition(0, geometryheight/2, -ARENASIZE+0.5); + arenaworld->addChild(arenaline); + + linegeometry = createBox(-ARENASIZE, ARENASIZE, -geometryheight/2, geometryheight/2-BLOCKHEIGHT, -0.5, 0.5); + arenaline = new MeshObject(linegeometry); + lineappearance = new MultiAppearance(); + line = new BasicBlockAppearance(ARENASIZE*2, 1, 1); + vectorSet(line->displacement, 0, -BLOCKHEIGHT*2.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(ARENASIZE*2, 1, 1); + vectorSet(line->displacement, 0, BLOCKHEIGHT*0.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + line = new BasicBlockAppearance(ARENASIZE*2, 1, 1); + vectorSet(line->displacement, 0, BLOCKHEIGHT*3.5, 0); + line->material.setColor(1, 0, 0, 1); + lineappearance->addAppearance(line), + arenaline->appearance = lineappearance; + arenaline->setCollisionGroup(COLLISIONGROUP_ARENA); + arenaline->setPosition(0, geometryheight/2, ARENASIZE-0.5); + arenaworld->addChild(arenaline); + + float movement[3]; + + man1 = new Legoman(PLAYER1); + man1->insertToWorld(arenaworld); + vectorSet(movement, -4, 0, 0); + man1->move(movement); + man1->lockPart(LEFTLEG | RIGHTLEG); + + man2 = new Legoman(PLAYER2); + man2->insertToWorld(arenaworld); + vectorSet(movement, 4, 0, 0); + man2->move(movement); + man2->lockPart(LEFTLEG | RIGHTLEG); + + man1->addOpponent(man2); + man2->addOpponent(man1); + + + initBloods(arenaworld); + + + hitsound1 = new Sound(DATAPATH"hit1.wav"); + softhitsound1 = new Sound(DATAPATH"hitsoft1.wav"); + softhitsound2 = new Sound(DATAPATH"hitsoft2.wav"); + jumpsound = new Sound(DATAPATH"jump.wav"); + fallsound1 = new Sound(DATAPATH"fall1.wav"); + fallsound2 = new Sound(DATAPATH"fall2.wav"); + fightsound = new Sound(DATAPATH"fight.wav"); + victorysound = new Sound(DATAPATH"victory.wav"); + + fightmusic = new Sound(DATAPATH"fight.mp3", true); + } + + float cameraTarget[3] = {0, 6, 0}; + camera.setTarget(cameraTarget); + arenaworld->prepare(); + + points1 = 0; + points2 = 0; + + winner = man1; +} + +#define MAXSCORE 3 + +int trophycounter = -1; + +void resetFight(void){ + float movement[3]; + man1->heal(); + man2->heal(); + + vectorSet(movement, -4, 0, 0); + man1->move(movement); + vectorSet(movement, 4, 0, 0); + man2->move(movement); + + man1->lockPart(LEFTLEG | RIGHTLEG); + man2->lockPart(LEFTLEG | RIGHTLEG); +} + +int startcounter, endcounter; + +float fightfade; + +bool dead; + +Legoman *winner; + +void gameOver(Legoman *loser){ + endcounter = 0; + dead = true; + winner = loser->getOpponent(); +} + +void startFight(void){ + resetFight(); + fightmusic->setVolume(0); + fightmusic->play(); + fightmusic->fadeIn(300); + startcounter = 0; + trophycounter = -1; + fightfade = 1; + dead = false; + points1 = 0; + points2 = 0; +} + +SDLKey player1left = SDLK_LEFT; +SDLKey player1right = SDLK_RIGHT; +SDLKey player1forward = SDLK_UP; +SDLKey player1backward = SDLK_DOWN; +SDLKey player1jump = SDLK_RSHIFT; +SDLKey player1hit = SDLK_RCTRL; + +SDLKey player2left = SDLK_a; +SDLKey player2right = SDLK_d; +SDLKey player2forward = SDLK_w; +SDLKey player2backward = SDLK_s; +SDLKey player2jump = SDLK_LSHIFT; +SDLKey player2hit = SDLK_LCTRL; + + +void stopGame(void){ + light1.setEnabled(false); + light2.setEnabled(false); + light3.setEnabled(false); + light4.setEnabled(false); + changeGameMode(MENUMODE); + fightmusic->fadeOut(300); + menuRestart(); +} + +void endGame(void){ + trophycounter = 0; +} + +void endGame2(void){ + light1.setEnabled(false); + light2.setEnabled(false); + light3.setEnabled(false); + light4.setEnabled(false); + changeGameMode(ENDMODE); + winner->heal(); + endRestart(); +} + +#define READY 250 +#define FIGHT 500 +#define VICTORY 300 +#define VICTORYEND 700 +#define ENDFADE 780 +#define STARTOVER 800 + +#define TROPHYFADE 400 + +void calculateFight(int framecount){ + fightfade = -1; + if (startcounter < 200){ + fightfade = (200-startcounter)/200.0; + } + if (startcounter == FIGHT - 30){ + fightsound->play(); + } + startcounter++; + + if (endcounter == VICTORY){ + victorysound->play(); + if (winner == man1) points1++; + if (winner == man2) points2++; + } + if (endcounter >= ENDFADE && endcounter <= STARTOVER){ + fightfade = (endcounter - ENDFADE)/(STARTOVER-ENDFADE); + } + if (endcounter == STARTOVER){ + if (points1 == MAXSCORE || points2 == MAXSCORE){ + endGame(); + } else{ + startcounter = 0; + resetFight(); + dead = false; + endcounter = 0; + } + } + if (dead) endcounter++; + if (trophycounter != -1){ + fightfade = (float)trophycounter/TROPHYFADE; + trophycounter++; + if (trophycounter == TROPHYFADE) endGame2(); + } + + /*if (framecount % 10 == 0){ + float pos[3] = {0, 5, 0}; + float vel[3] = {randomf(2)-1, randomf(2)-1, randomf(2)-1}; + createBlood(pos, vel); + }*/ + //arenalight.setPosition(sin(framecount*0.01)*6, 3, cos(framecount*0.01)*4); + //light2.setPosition(sin(framecount*0.017)*6, 2, cos(framecount*0.027)*5); + //light3.setPosition(sin(framecount*0.023)*3, 4, cos(framecount*0.013)*3); + + camera.setPosition(sin(framecount*0.0005)*20, sin(framecount*0.0013)*5+15, cos(framecount*0.0005)*20); + + //camera.setPosition(8, 5, 5); + + float upmovement[3] = {0, 0.001, 0}; + man1->move(upmovement); + man2->move(upmovement); + man1->update(); + man2->update(); + + if (startcounter >= FIGHT){ + + if (man1->isAlive()){ + if (keys[player1left]) man1->turn(5); + if (keys[player1right]) man1->turn(-5); + if (keys[player1forward]) man1->walk(0.03); + if (keys[player1backward]) man1->walk(-0.03); + if (keys[player1jump]) man1->jump(); + if (keys[player1hit]) man1->hit(); + } + + if (man2->isAlive()){ + if (keys[player2left]) man2->turn(5); + if (keys[player2right]) man2->turn(-5); + if (keys[player2forward]) man2->walk(0.03); + if (keys[player2backward]) man2->walk(-0.03); + if (keys[player2jump]) man2->jump(); + if (keys[player2hit]) man2->hit(); + } + } + + + if (keys[SDLK_ESCAPE]){ + stopGame(); + } + + + arenaworld->move(); +} + +void drawDamageMeters(void){ + enable2D(); + + glEnable(GL_BLEND); + + glPushMatrix(); + glTranslatef(0.925, 0.22-0.025, 0); + glScalef(0.08*3/4, 0.08, 0.1); + man1->drawVisuals(); + glPopMatrix(); + + glPushMatrix(); + glTranslatef(0.075, 0.22-0.025, 0); + glScalef(0.08*3/4, 0.08, 0.1); + man2->drawVisuals(); + glPopMatrix(); + + glDisable(GL_TEXTURE_2D); + + + glColor3f(1, 1, 0); + + char pointstring[5]; + sprintf(pointstring, "%i", points1); + print(0.75, 0.05, pointstring, 0.15); + + sprintf(pointstring, "%i", points2); + print(0.15, 0.05, pointstring, 0.15); + + disable2D(); +} + +void drawFight(int framecount){ + glLoadIdentity(); + camera.glUpdate(); + //float position[3]; + //camera.getPosition((float*)position); + //createSkyBox(position[0], position[1], position[2], 50, 20, 50); + + createSkyBox(0, 10, 0, 50, 20, 50); + + + light1.setEnabled(true); + light2.setEnabled(true); + light3.setEnabled(true); + light4.setEnabled(true); + + updateLights(); + + arenaworld->draw(); + + drawDamageMeters(); + + + flaretexture->enable(); + light1.createFlare(); + light2.createFlare(); + light3.createFlare(); + light4.createFlare(); + flaretexture->disable(); + + + enable2D(); + + if (fightfade != -1){ + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0, 0, 0, fightfade); + glBegin(GL_QUADS); + glVertex2f(0, 0); + glVertex2f(1, 0); + glVertex2f(1, 1); + glVertex2f(0, 1); + glEnd(); + } + + if (startcounter >= READY && startcounter < FIGHT){ + float size = 0.2 - (startcounter - READY)*0.0001; + float alpha = 1 - (float)(startcounter - READY)/(FIGHT - READY); + float x = 0.5 - size*1.5; + float y = 0.5 - size*0.5; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(alpha, 0, 0, alpha); + print(x, y, "Ready", size); + } + if (startcounter >= FIGHT && startcounter < FIGHT+200){ + float size = 0.2 + (startcounter - FIGHT)*0.0005; + float alpha = 1 - (float)(startcounter - FIGHT)/200; + float x = 0.5 - size*1.4; + float y = 0.5 - size*0.5; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0, alpha, 0, alpha); + print(x, y, "Fight!", size); + } + + if (dead){ + if (endcounter >= VICTORY && endcounter < VICTORYEND){ + float size = 0.18 + (endcounter - VICTORY)*0.0001; + float alpha = (float)(endcounter - VICTORY)/(VICTORYEND-VICTORY); + alpha = 1-4*(alpha-0.5)*(alpha-0.5); + alpha = pow(alpha, 0.5); + float x = 0.5 - size*1.9; + float y = 0.3 - size*0.5; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0, 0, alpha, alpha); + print(x, y, "Victory!", size); + } + } + + disable2D(); + + + glDisable(GL_BLEND); + glEnable(GL_DEPTH_TEST); +} diff --git a/src/fight.h b/src/fight.h new file mode 100644 index 0000000..f069a0a --- /dev/null +++ b/src/fight.h @@ -0,0 +1,91 @@ +/* + * $Id: fight.h,v 1.17 2002/07/22 01:14:14 msell Exp $ + * + * + * $Log: fight.h,v $ + * Revision 1.17 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.16 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.15 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.14 2002/07/19 20:06:32 msell + * Linux-porttausta + * + * Revision 1.13 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.12 2002/07/19 14:05:52 msell + * Damagetextuurit näkyy + * + * Revision 1.11 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.10 2002/07/17 22:45:54 msell + * Ääniä vähän + * + * Revision 1.9 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * Revision 1.8 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.7 2002/07/14 21:22:40 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.6 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.5 2002/07/07 15:29:07 msell + * Törmäyksien parantelua + * + * Revision 1.4 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.3 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.2 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * Revision 1.1 2002/05/16 18:42:07 msell + * Vektorifunctioita ja kamera + * + * + * + * $Date: 2002/07/22 01:14:14 $ + * + */ + +#ifndef __FIGHT_H_INCLUDED__ +#define __FIGHT_H_INCLUDED__ + +#include +#include "audio.h" +#include "legoman.h" + +extern Sound *fightmusic; +extern Sound *hitsound1; +extern Sound *softhitsound1, *softhitsound2; +extern Sound *jumpsound; +extern Sound *fallsound1, *fallsound2; + +extern bool dead; + +extern Legoman *winner; + +void initFight(void); +void gameOver(Legoman *loser); +void startFight(void); +void calculateFight(int framecount); +void drawFight(int framecount); + +void handleKeydownFight(SDLKey key); +void addGraphicsVector(float *p1, float *p2, float size); + +#endif + diff --git a/src/font.cpp b/src/font.cpp new file mode 100644 index 0000000..39f93a8 --- /dev/null +++ b/src/font.cpp @@ -0,0 +1,102 @@ +/* + * $Id: font.cpp,v 1.6 2002/07/21 20:14:28 msell Exp $ + * + * + * $Log: font.cpp,v $ + * Revision 1.6 2002/07/21 20:14:28 msell + * no message + * + * Revision 1.5 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.4 2002/07/19 14:05:52 msell + * Damagetextuurit näkyy + * + * Revision 1.3 2002/07/19 12:10:53 msell + * Hups + * + * Revision 1.2 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.1 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * + * + * $Date: 2002/07/21 20:14:28 $ + * + */ + +#include "main.h" + +#include "font.h" +#include "glapi.h" + +Texture *fonttexture; + +void drawChar(float x, float y, char ch, float size){ + fonttexture->enable(); + + int tx = (ch&15)*64; + int ty = (ch>>4)*64; + + float w = size, h = size*4/3; + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); + + glBegin(GL_QUADS); + glTexCoord2f((tx)/1024.0, (ty)/1024.0); + glVertex2f(x, y); + + glTexCoord2f((tx)/1024.0, (ty+64)/1024.0); + glVertex2f(x, y+h); + + glTexCoord2f((tx+64)/1024.0, (ty+64)/1024.0); + glVertex2f(x+w, y+h); + + glTexCoord2f((tx+64)/1024.0, (ty)/1024.0); + glVertex2f(x+w, y); + + glEnd(); + + fonttexture->disable(); +} + +float letterwidth[256] = { + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 0.5, 0.2, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.45, 0.2, 0.5, + 0.6, 0.5, 0.6, 0.6, 0.65, 0.65, 0.6, 0.65, 0.6, 0.6, 0.2, 1.0, 1.0, 1.0, 1.0, 0.5, + 1.0, 0.7, 0.6, 0.7, 0.7, 0.65, 0.6, 0.7, 0.8, 0.6, 0.7, 0.7, 0.6, 0.9, 0.85, 0.8, + 0.6, 0.9, 0.7, 0.7, 0.7, 0.7, 0.7, 1.0, 0.8, 0.7, 0.8, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 0.6, 0.6, 0.6, 0.6, 0.6, 0.5, 0.6, 0.6, 0.2, 0.4, 0.6, 0.2, 0.8, 0.5, 0.55, + 0.55, 0.55, 0.5, 0.55, 0.55, 0.55, 0.6, 0.8, 0.6, 0.6, 0.6, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 +}; + +void print(float x, float y, char *text, float size){ + int i; + int textlength = strlen(text); + float px = x; + float py = y; + for (i = 0; i < textlength; i++){ + char ch = text[i]; + if (ch == '\n'){ + px = x; + py += size*1.2; + } else{ + drawChar(px, py, ch, size); + px += size*letterwidth[ch]; + } + } +} + + diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..3c54a37 --- /dev/null +++ b/src/font.h @@ -0,0 +1,33 @@ +/* + * $Id: font.h,v 1.3 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: font.h,v $ + * Revision 1.3 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.2 2002/07/19 14:05:52 msell + * Damagetextuurit näkyy + * + * Revision 1.1 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __FONT_H_INCLUDED__ +#define __FONT_H_INCLUDED__ + +#include "texture.h" + +extern Texture *fonttexture; + +//Top left = 0.0 , 0.0 Bottom right = 1.0 , 1.0 +void drawChar(float x, float y, char ch, float size = 0.05); +void print(float x, float y, char *text, float size = 0.05); + +#endif + diff --git a/src/glapi.cpp b/src/glapi.cpp new file mode 100644 index 0000000..6cd5ab1 --- /dev/null +++ b/src/glapi.cpp @@ -0,0 +1,103 @@ +/* + * $Id: glapi.cpp,v 1.9 2002/07/21 15:03:12 msell Exp $ + * + * + * $Log: glapi.cpp,v $ + * Revision 1.9 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.8 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.7 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.6 2002/06/05 18:39:04 msell + * Jotain pientä + * + * Revision 1.5 2002/06/05 15:00:41 msell + * Palikoihin lisää detailia, facet jaetaan halutun kokosiin osiin + * + * Revision 1.4 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.3 2002/05/17 23:13:30 msell + * Valot + * + * Revision 1.2 2002/05/16 18:41:16 msell + * Vektorifunctioita ja kamera + * + * Revision 1.1 2002/05/15 14:36:39 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/21 15:03:12 $ + * + */ + +#include "main.h" + +#include "glapi.h" + +void setupOpengl(int width, int height){ + //float ratio = (float)width/height; + float ratio = 4.0/3.0; + + glShadeModel(GL_SMOOTH); + + glCullFace(GL_BACK); + glFrontFace(GL_CCW); + glEnable(GL_CULL_FACE); + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); + glClearDepth(1.0); + + glClearColor(0, 0, 0, 0); + + glEnable(GL_COLOR_MATERIAL); + + //Enables lighting with zero initial lights. Lights are created with Light-class + glEnable(GL_LIGHTING); + glDisable(GL_LIGHT0); + + float ambient[4]= {0.1, 0.1, 0.1, 1}; + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient); + + glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + + GLfloat zero[4] = {0, 0, 0, 1}; + GLfloat one[4] = {1, 1, 1, 1}; + + //Default frontface lighting + glMaterialfv(GL_FRONT, GL_AMBIENT, one); + glMaterialfv(GL_FRONT, GL_DIFFUSE, one); + GLfloat specular[4] = {2, 2, 2, 1}; + glMaterialfv(GL_FRONT, GL_SPECULAR, specular); + glMaterialf(GL_FRONT, GL_SHININESS, 120); + + //Never any backface lighting, except ambient + glMaterialfv(GL_BACK, GL_AMBIENT, one); + glMaterialfv(GL_BACK, GL_DIFFUSE, zero); + glMaterialfv(GL_BACK, GL_SPECULAR, zero); + + + + glViewport(0, 0, width, height); + + glDepthFunc(GL_LEQUAL); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + + glEnable(GL_NORMALIZE); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + gluPerspective(60.0, ratio, 1.0, 1024.0); + + + //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +} diff --git a/src/glapi.h b/src/glapi.h new file mode 100644 index 0000000..6319b61 --- /dev/null +++ b/src/glapi.h @@ -0,0 +1,40 @@ +/* + * $Id: glapi.h,v 1.6 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: glapi.h,v $ + * Revision 1.6 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.5 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.4 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.3 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.2 2002/05/16 18:41:16 msell + * Vektorifunctioita ja kamera + * + * Revision 1.1 2002/05/15 14:36:39 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __GLAPI_H_INCLUDED__ +#define __GLAPI_H_INCLUDED__ + +#include + +void setupOpengl(int width, int height); + +#endif + + diff --git a/src/graphics.cpp b/src/graphics.cpp new file mode 100644 index 0000000..995f697 --- /dev/null +++ b/src/graphics.cpp @@ -0,0 +1,295 @@ +/* + * $Id: graphics.cpp,v 1.17 2002/07/21 15:03:12 msell Exp $ + * + * + * $Log: graphics.cpp,v $ + * Revision 1.17 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.16 2002/07/19 22:01:35 msell + * Säätöä + * + * Revision 1.15 2002/07/19 21:32:54 msell + * Mipmap pois + * + * Revision 1.14 2002/07/19 21:17:06 msell + * bugifixi + * + * Revision 1.13 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.12 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.11 2002/06/28 14:51:40 jkaarlas + * transparenttilatausta korjailtu + * + * Revision 1.10 2002/06/27 21:42:32 jkaarlas + * lisätty transparentin tekstuurin lataus + * + * Revision 1.9 2002/06/26 18:54:43 jkaarlas + * Nyt se lataus vihdoin toimii + * + * Revision 1.8 2002/06/20 15:30:22 jkaarlas + * tekstuurisäätöä + * + * Revision 1.7 2002/06/19 22:44:56 jkaarlas + * lisätty glTexEnvf lataukseen + * + * Revision 1.6 2002/06/17 20:49:04 msell + * free -> SDL_FreeSurface + * + * Revision 1.5 2002/06/17 20:24:20 jkaarlas + * pahimmat bugit korjattu + * + * Revision 1.4 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.3 2002/06/17 16:51:38 jkaarlas + * realloc korjattu + * + * Revision 1.2 2002/06/16 01:05:18 jkaarlas + * vähän lihaa luiden ympärille näihinkin + * + * + * + * $Date: 2002/07/21 15:03:12 $ + * + */ + +#include "graphics.h" +#include + +GraphicsDruid *GraphicsDruid::instance = 0; + +GraphicsDruid::GraphicsDruid(void){ + this->reserved = 0; +} + +GraphicsDruid::~GraphicsDruid(void){ +} + +void GraphicsDruid::init(void){ + instance->textureCount = 0; + instance->reserved = ID_ARRAY_INIT_SIZE; + instance->idArray = (int*) calloc(ID_ARRAY_INIT_SIZE, sizeof(int)); + + for (int i=0; i < instance->reserved; i++){ + instance->idArray[i] = -1; + } +} + +void GraphicsDruid::destroy(void){ + if (instance->textureCount > 0){ + glDeleteTextures(GL_TEXTURE_2D, (const unsigned int*)instance->idArray); + } + free(instance->idArray); + instance->idArray = 0; + delete instance; + instance = 0; +} + +GraphicsDruid &GraphicsDruid::getInstance(void){ + + if (!instance){ + instance = new GraphicsDruid; + init(); + } + return *instance; +} + +int GraphicsDruid::loadTexture(SDL_Surface *texture, int id, int format){ + + int textureID = id == -1 ? getNewTextureID(id) : id; + + // register texture in OpenGL + glBindTexture (GL_TEXTURE_2D, textureID); + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);//_MIPMAP_NEAREST); + //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + + //printf("w: %i, h: %i, format: %i, RGBA: %i, pixels: %p\n", + // texture->w, texture->h, format, GL_RGBA, texture->pixels); + //printf("Pitch: %i, Bpp: %i\n", texture->pitch, texture->format->BytesPerPixel); + + /*gluBuild2DMipmaps(GL_TEXTURE_2D, + 4, + texture->w, + texture->h, + format, + GL_UNSIGNED_BYTE, + texture->pixels);*/ + int w = texture->w; + int h = texture->h; + /*int i; + while (w > 0){ + w >>= 1; + i++; + } + w = 1; + for (;i > 1; i--) w <<= 1; + while (h > 0){ + h >>= 1; + i++; + } + h = 1; + for (;i > 1; i--) h <<= 1;*/ + //glTexImage2D(GL_TEXTURE_2D, 0, texture->format->BytesPerPixel, w, h, 0, format, GL_UNSIGNED_BYTE, texture->pixels); + if (texture->format->BytesPerPixel == 3){ + glTexImage2D(GL_TEXTURE_2D, 0, 3, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, texture->pixels); + } else if (texture->format->BytesPerPixel == 4){ + glTexImage2D(GL_TEXTURE_2D, 0, 4, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture->pixels); + } + //SDL_FreeSurface(texture); + //SDL_FreeSurface(alphaSurface); + return textureID; +} + +int GraphicsDruid::loadTexture(char* path, int id){ + + SDL_Surface* texture; + texture = IMG_Load(path); + + if (!texture){ +#ifdef _DEBUG + printf ("Error while loading image: %s\n", SDL_GetError()); +#endif + return -1; + } + int textureID = getNewTextureID(id); + + + // register texture in OpenGL + glBindTexture (GL_TEXTURE_2D, textureID); + + //glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + + // NOTE : Making some assumptions about texture parameters + //glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + //glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + //printf("w: %i, h: %i, RGBA: %i, pixels: %p\n", + // texture->w, texture->h, GL_RGBA, texture->pixels); + //printf("Pitch: %i, Bpp: %i\n", texture->pitch, texture->format->BytesPerPixel); + + if (texture->format->BytesPerPixel == 3){ + /*gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, + texture->w, + texture->h, + GL_RGB, GL_UNSIGNED_BYTE, + texture->pixels);*/ + glTexImage2D(GL_TEXTURE_2D, 0, 3, texture->w, texture->h, 0, GL_RGB, GL_UNSIGNED_BYTE, texture->pixels); + } + else if (texture->format->BytesPerPixel == 4){ + /*gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, + texture->w, + texture->h, + GL_RGBA, GL_UNSIGNED_BYTE, + texture->pixels);*/ + glTexImage2D(GL_TEXTURE_2D, 0, 4, texture->w, texture->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture->pixels); + } + +/* + + + gluBuild2DMipmaps(GL_TEXTURE_2D, + 0, + texture->w, + texture->h, + GL_RGBA, + GL_UNSIGNED_BYTE, + texture->pixels); + */ + SDL_FreeSurface(texture); + return textureID; +} + +int GraphicsDruid::loadTranspTexture(char* path, float* transpColor, int id){ + + SDL_Surface* texture; + texture = IMG_Load(path); + if (!texture){ +#ifdef _DEBUG + printf ("Error while loading image: %s\n", SDL_GetError()); +#endif + return -1; + } + + + Uint32 colorKey = SDL_MapRGB(texture->format, + (Uint8)(transpColor[0] * 255), + (Uint8)(transpColor[1] * 255), + (Uint8)(transpColor[2] * 255)); + //SDL_SetAlpha(texture, 0, SDL_ALPHA_OPAQUE); + + SDL_SetColorKey(texture, SDL_SRCCOLORKEY, colorKey); + + //SDL_Surface* alphaSurface = SDL_DisplayFormatAlpha(texture); + texture = SDL_DisplayFormatAlpha(texture); + + return loadTexture(texture); +} + +int GraphicsDruid::getNewTextureID(int id){ + + if (id != -1){ + for (int i = 0; i < instance->reserved; i++){ + if (instance->idArray[i] == id){ + freeTexture(id); + instance->textureCount--; + break; + } + } + } + + GLuint newId; + + if (id == -1){ + glGenTextures (1, &newId); + } + else + newId = id; + + int index = 0; + while (instance->idArray[index] != -1 && index < instance->reserved){ + index++; + } + + // out of space, make more + if (index >= instance->reserved){ + instance->idArray = (int*) realloc(instance->idArray, (instance->reserved + ID_ARRAY_GROW)*sizeof(int)); + + for (int i = instance->reserved + 1; i < instance->reserved + ID_ARRAY_GROW; i++) + instance->idArray[i] = -1; + + instance->reserved += ID_ARRAY_GROW; + } + else + instance->idArray[index] = newId; + + + instance->textureCount++; + return newId; +} + +void GraphicsDruid::freeTexture(int id){ + if (id > -1 && id < instance->reserved){ + instance->idArray[id] = -1; + const unsigned int helpInt = id; + glDeleteTextures(1, &helpInt); + } +} + diff --git a/src/graphics.h b/src/graphics.h new file mode 100644 index 0000000..b9dba1a --- /dev/null +++ b/src/graphics.h @@ -0,0 +1,89 @@ +/* + * $Id: graphics.h,v 1.9 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: graphics.h,v $ + * Revision 1.9 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.8 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.7 2002/06/28 14:51:40 jkaarlas + * transparenttilatausta korjailtu + * + * Revision 1.6 2002/06/27 21:42:32 jkaarlas + * lisätty transparentin tekstuurin lataus + * + * Revision 1.5 2002/06/17 20:49:04 msell + * free -> SDL_FreeSurface + * + * Revision 1.4 2002/06/17 20:24:20 jkaarlas + * pahimmat bugit korjattu + * + * Revision 1.3 2002/06/17 16:51:38 jkaarlas + * realloc korjattu + * + * Revision 1.2 2002/06/16 01:05:18 jkaarlas + * vähän lihaa luiden ympärille näihinkin + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __GRAPHICS_H_INCLUDED__ +#define __GRAPHICS_H_INCLUDED__ + +#ifdef WIN32 +#pragma warning ( disable : 4700 ) +#endif + +#include "main.h" +#include "texture.h" +#include "glapi.h" + +const int ID_ARRAY_INIT_SIZE = 16; +const int ID_ARRAY_GROW = 8; + +#define DRUID GraphicsDruid::getInstance() +#define DIE_DRUID_DIE GraphicsDruid::destroy() +typedef unsigned char byte; +typedef struct jpeg_pixel{ + Uint8 red; + Uint8 green; + Uint8 blue; +}jpeg_pixel; + + + +class GraphicsDruid{ + +private: + + static GraphicsDruid* instance; + int* idArray; + int textureCount; + int reserved; + + GraphicsDruid(void); + ~GraphicsDruid(void); + + static void init(void); + static void destroy(void); + +public: + + static GraphicsDruid &getInstance(void); + int loadTexture(SDL_Surface *texture, int id = -1, int format = GL_RGB); + int loadTexture(char* path, int id = -1); + int loadTranspTexture(char* path, float* transpColor, int id = -1); + void freeTexture(int id); + void freeAll(void); + int getNewTextureID(int id); + +}; + +#endif + diff --git a/src/legoblocks.cpp b/src/legoblocks.cpp new file mode 100644 index 0000000..db77eb5 --- /dev/null +++ b/src/legoblocks.cpp @@ -0,0 +1,522 @@ +/* + * $Id: legoblocks.cpp,v 1.20 2002/07/22 11:44:37 jkaarlas Exp $ + * + * + * $Log: legoblocks.cpp,v $ + * Revision 1.20 2002/07/22 11:44:37 jkaarlas + * naama + * + * Revision 1.19 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.18 2002/07/17 20:32:47 msell + * Detail-optio toimii + * + * Revision 1.17 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * Revision 1.16 2002/07/16 00:42:43 msell + * Uusia skyboxeja ja areenan säätöä + * + * Revision 1.15 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.14 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.13 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.12 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.11 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.10 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.9 2002/06/24 04:41:43 jkaarlas + * tekstuurikoordinaatteja korjattu + * + * Revision 1.8 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.7 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.6 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.5 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.4 2002/06/05 18:39:04 msell + * Jotain pientä + * + * Revision 1.3 2002/06/05 15:00:41 msell + * Palikoihin lisää detailia, facet jaetaan halutun kokosiin osiin + * + * Revision 1.2 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.1 2002/06/03 23:06:38 msell + * no message + * + * + * + * + * $Date: 2002/07/22 11:44:37 $ + * + */ + +#include "main.h" + +#include + +#include "legoblocks.h" +#include "utils.h" +#include "3dutils.h" +#include "objectfactory.h" +#include "vector.h" +#include "glapi.h" + +BasicBlock::BasicBlock(int width, int height, int depth) : MeshObject(createBox(-width/2.0, width/2.0, -height/2.0*BLOCKHEIGHT, BLOCKHEIGHT*height/2.0, -depth/2.0, depth/2.0)){ + appearance = new BasicBlockAppearance(width, height, depth); + //geometry = new MeshShape(this); +} + +void BasicBlock::setColor(float red, float green, float blue){ + appearance->getMaterial()->setColor(red, green, blue, 1); +} + + + +BasicBlockAppearance::BasicBlockAppearance(int width, int height, int depth){ + this->width = width; + this->height = height; + this->depth = depth; + vectorSet(displacement, 0, 0, 0); + gllist = glGenLists(1); + usematerial = true; +} + +void BasicBlockAppearance::prepare(){ + glNewList(gllist, GL_COMPILE); + + + float width = this->width; + float height = this->height * BLOCKHEIGHT; + + if (usematerial) material.enable(); + {//Block + //Front Face + glPushMatrix(); + glTranslatef(-width/2.0, -height/2.0, depth/2.0); + drawDetailRectangle(width, height); + glPopMatrix(); + + // Back Face + glPushMatrix(); + glTranslatef(width/2.0, -height/2.0, -depth/2.0); + glRotatef(180, 0, 1, 0); + drawDetailRectangle(width, height); + glPopMatrix(); + + // Top Face + glPushMatrix(); + glTranslatef(-width/2.0, height/2.0, depth/2.0); + glRotatef(-90, 1, 0, 0); + drawDetailRectangle(width, depth); + glPopMatrix(); + + // Bottom Face + glPushMatrix(); + glTranslatef(-width/2.0, -height/2.0, -depth/2.0); + glRotatef(90, 1, 0, 0); + drawDetailRectangle(width, depth); + glPopMatrix(); + + // Right face + glPushMatrix(); + glTranslatef(width/2.0, -height/2.0, depth/2.0); + glRotatef(90, 0, 1, 0); + drawDetailRectangle(depth, height); + glPopMatrix(); + + // Left Face + glPushMatrix(); + glTranslatef(-width/2.0, -height/2.0, -depth/2.0); + glRotatef(-90, 0, 1, 0); + drawDetailRectangle(depth, height); + glPopMatrix(); + } + + glPushMatrix(); + glTranslatef(0.5 - width/2.0, height - height/2.0, 0.5 - depth/2.0); + int x, z; + for (x = 0; x < width; x++){ + //glPushMatrix(); + for (z = 0; z < depth; z++){ + createKnob(); + glTranslatef(0, 0, 1); + } + glTranslatef(1, 0, -depth); + //glPopMatrix(); + } + glPopMatrix(); + + if (usematerial) material.disable(); + glEndList(); +} + +void BasicBlockAppearance::draw(){ + glPushMatrix(); + glTranslatef(displacement[0], displacement[1], displacement[2]); + glCallList(gllist); + glPopMatrix(); + //prepare(); +} + + +#define BLOCKDETAILGRID 1 + +void drawDetailRectangle(float width, float height){ + glBegin(GL_QUADS); + float x, y, x2, y2; + glNormal3f(0, 0, 1); + + for (y = 0; y < height; y += BLOCKDETAILGRID){ + y2 = y + BLOCKDETAILGRID; + if (y2 > height) y2 = height; + for (x = 0; x < width; x += BLOCKDETAILGRID){ + x2 = x + BLOCKDETAILGRID; + if (x2 > width) x2 = width; + + glTexCoord2f(x / width, y / height); + glVertex3f(x, y, 0); + + glTexCoord2f(x2 / width, y / height); + glVertex3f(x2, y, 0); + + glTexCoord2f(x2 / width, y2 / height); + glVertex3f(x2, y2, 0); + + glTexCoord2f(x / width, y2 / height); + glVertex3f(x, y2, 0); + } + } + glEnd(); +} + +#define KNOBROUNDNESS 0.03 + +int knobgllist; +int knobdetail; + +void renderKnob(int knobsegments){ + point2d knobpoints[4]; + knobpoints[0].x = 0.3; + knobpoints[0].y = 0; + knobpoints[1].x = 0.3; + knobpoints[1].y = BLOCKHEIGHT*0.5 - KNOBROUNDNESS; + knobpoints[2].x = 0.3 - KNOBROUNDNESS; + knobpoints[2].y = BLOCKHEIGHT*0.5; + knobpoints[3].x = 0; + knobpoints[3].y = BLOCKHEIGHT*0.5; + + point2d knobderivates[4]; + knobderivates[0].x = 0; + knobderivates[0].y = knobpoints[1].y - knobpoints[0].y; + knobderivates[1].x = 0; + knobderivates[1].y = knobpoints[2].y - knobpoints[1].y; + knobderivates[2].x = knobpoints[2].x - knobpoints[1].x; + knobderivates[2].y = 0; + knobderivates[3].x = knobpoints[3].x - knobpoints[2].x; + knobderivates[3].y = 0; + + createLathedSurface(knobpoints, knobderivates, 4, knobsegments, 4); +} + +void initKnob(void){ + glNewList(knobgllist, GL_COMPILE); + + renderKnob(knobdetail); + + glEndList(); +} + +void createKnob(int knobsegments){ + if (knobsegments != -1){ + renderKnob(knobsegments); + return; + } + glCallList(knobgllist); +} + + + + + +float knobroundness=0.05; +float pillarroundness=0.03; + +HeadAppearance::HeadAppearance(void){ + gllist = glGenLists(1); +} + +void HeadAppearance::prepare(void){ + glNewList(gllist, GL_COMPILE); + + glPushMatrix(); + + glTranslatef(0, -0.5, 0); + + point2d headpoints[14]; + + headpoints[0].x=0.0; headpoints[0].y=BLOCKHEIGHT*(0); + headpoints[1].x=0.4; headpoints[1].y=BLOCKHEIGHT*(0); + headpoints[2].x=0.45; headpoints[2].y=BLOCKHEIGHT*(0.35); + headpoints[3].x=0.55; headpoints[3].y=BLOCKHEIGHT*(0.5); + headpoints[4].x=0.62*1.0; headpoints[4].y=BLOCKHEIGHT*(0.65); + headpoints[5].x=0.65*1.0; headpoints[5].y=BLOCKHEIGHT*(1); + headpoints[6].x=0.65*1.0; headpoints[6].y=BLOCKHEIGHT*(1.75); + headpoints[7].x=0.65*1.0; headpoints[7].y=BLOCKHEIGHT*(2.35); + headpoints[8].x=0.62*1.0; headpoints[8].y=BLOCKHEIGHT*(2.60); + headpoints[9].x=0.55*1.0; headpoints[9].y=BLOCKHEIGHT*(2.80); + headpoints[10].x=0.4; headpoints[10].y=BLOCKHEIGHT*(2.95); + headpoints[11].x=0.3; headpoints[11].y=BLOCKHEIGHT*3.5-pillarroundness; + headpoints[12].x=0.3-pillarroundness; headpoints[12].y=BLOCKHEIGHT*3.5; + headpoints[13].x=0; headpoints[13].y=BLOCKHEIGHT*3.5; + headpoints[11].x=0; headpoints[11].y=BLOCKHEIGHT*3.0; + + glColor4f(0.8,0.8,0.0,1.0); + + + faceTexture->enable(); + glBlendFunc(GL_ONE, GL_SRC_ALPHA); + createLathedSurface(headpoints,NULL,12,16,24); + faceTexture->disable(); + + glTranslatef(0, BLOCKHEIGHT*3-0.05, 0); + + createKnob(16); + + glPopMatrix(); + + glEndList(); +} + +void HeadAppearance::draw(void){ + glCallList(gllist); +} + + + + + +FlowerAppearance::FlowerAppearance(int color1, int color2, int color3){ + gllist = glGenLists(1); + this->color1 = color1; + this->color2 = color2; + this->color3 = color3; +} + +void FlowerAppearance::prepare(void){ + glNewList(gllist, GL_COMPILE); + + glPushMatrix(); + + + int colors[]={color1,color2,color3}; + + glColor3f(0.0,0.6,0.0); + + point2d basepoints[8]; + basepoints[0].x=0.4; basepoints[0].y=0; + basepoints[1].x=0.4; basepoints[1].y=BLOCKHEIGHT*1.5-pillarroundness; + basepoints[2].x=0.4-pillarroundness; basepoints[2].y=BLOCKHEIGHT*1.5; + basepoints[3].x=0.3+pillarroundness; basepoints[3].y=BLOCKHEIGHT*1.5; + basepoints[4].x=0.3; basepoints[4].y=BLOCKHEIGHT*1.5+pillarroundness; + basepoints[5].x=0.3; basepoints[5].y=BLOCKHEIGHT*2.0-pillarroundness; + basepoints[6].x=0.3-pillarroundness; basepoints[6].y=BLOCKHEIGHT*2.0; + basepoints[7].x=0; basepoints[7].y=BLOCKHEIGHT*2.0; + + point2d basederivates[8]; + basederivates[0].x=0; basederivates[0].y=basepoints[1].y-basepoints[0].y; + basederivates[1].x=0; basederivates[1].y=basepoints[2].y-basepoints[1].y; + basederivates[2].x=basepoints[2].x-basepoints[1].x; basederivates[2].y=0; + basederivates[3].x=basepoints[4].x-basepoints[3].x; basederivates[3].y=0; + basederivates[4].x=0; basederivates[4].y=basepoints[4].y-basepoints[3].y; + basederivates[5].x=0; basederivates[5].y=basepoints[6].y-basepoints[5].y; + basederivates[6].x=basepoints[6].x-basepoints[5].x; basederivates[6].y=0; + basederivates[7].x=basepoints[7].x-basepoints[6].x; basederivates[7].y=0; + + createLathedSurface(basepoints,basederivates,8,8,8); + + int i,j; + for (i=0;i<3;i++){ + glColor3f(0.0,0.6,0.0); + glPushMatrix(); + glTranslatef(0,BLOCKHEIGHT,0.4); + glRotatef(20-90,1,0,0); + gluCylinder(gluNewQuadric(),0.1,0.1,BLOCKHEIGHT*(3+i*0.7),4,1); + glRotatef(90,1,0,0); + glTranslatef(0,BLOCKHEIGHT*(3+i*0.7),0); + + float r,g,b; + switch(colors[i]){ + case FLOWER_RED: + r=1.0; g=0.0; b=0.0; + break; + case FLOWER_YELLOW: + r=1.0; g=1.0; b=0.0; + break; + case FLOWER_WHITE: + r=1.0; g=1.0; b=1.0; + break; + } + + glDisable(GL_CULL_FACE); + glColor3f(r,g,b); + createKnob(); + + /* Terälehdet tehdään triangle-fanilla */ + glBegin(GL_TRIANGLE_FAN); + glNormal3f(0.0,1.0,0.0); + glVertex3f(0.0,0.0,0.0); + float x,z; + for (j=0;j<24;j+=4){ + x=sin((j+0)*2*PI/24)*0.4; + z=cos((j+0)*2*PI/24)*0.4; + glVertex3f(x,0.0,z); + x=sin((j+1)*2*PI/24)*0.55; + z=cos((j+1)*2*PI/24)*0.55; + glVertex3f(x,0.0,z); + x=sin((j+2)*2*PI/24)*0.6; + z=cos((j+2)*2*PI/24)*0.6; + glVertex3f(x,0.0,z); + x=sin((j+3)*2*PI/24)*0.55; + z=cos((j+3)*2*PI/24)*0.55; + glVertex3f(x,0.0,z); + } + glVertex3f(0,0.0,0.4); + glEnd(); + glEnable(GL_CULL_FACE); + + glPopMatrix(); + + glRotatef(120,0,1,0); + } + + glPopMatrix(); + + glEndList(); +} + +void FlowerAppearance::draw(void){ + glCallList(gllist); +} + + + + + +LampAppearance::LampAppearance(void){ + gllist = glGenLists(1); +} + +void LampAppearance::prepare(void){ + glNewList(gllist, GL_COMPILE); + + glPushMatrix(); + + //glTranslatef(0, -1, 0); + + //glRotatef(180, 1, 0, 0); + + glDisable(GL_LIGHTING); + + point2d lightpoints[11]; + lightpoints[0].x=0.4; lightpoints[0].y=BLOCKHEIGHT*(0); + lightpoints[1].x=0.55; lightpoints[1].y=BLOCKHEIGHT*(0); + lightpoints[2].x=0.62; lightpoints[2].y=BLOCKHEIGHT*(0+0.15); + lightpoints[3].x=0.65; lightpoints[3].y=BLOCKHEIGHT*(0+0.5); + lightpoints[4].x=0.68; lightpoints[4].y=BLOCKHEIGHT*(0+1.25); + lightpoints[5].x=0.65; lightpoints[5].y=BLOCKHEIGHT*(0+2); + lightpoints[6].x=0.62; lightpoints[6].y=BLOCKHEIGHT*(0+2.35); + lightpoints[7].x=0.55; lightpoints[7].y=BLOCKHEIGHT*(0+2.5); + lightpoints[8].x=0.4; lightpoints[8].y=BLOCKHEIGHT*(0+2.5); + lightpoints[9].x=0.4; lightpoints[9].y=BLOCKHEIGHT*(0+3); + lightpoints[10].x=0.0; lightpoints[10].y=BLOCKHEIGHT*(0+3); + glColor4f(0.8,0.8,0.8,0.5); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + createLathedSurface(lightpoints,NULL,11,8,11); + + glEnable(GL_LIGHTING); + + /*glColor3f(0.5, 0.5, 0.5); + + glBegin(GL_LINES); + glVertex3f(0, 1, 0); + glVertex3f(0, -100, 0); + glEnd();*/ + + + /*float screencoords[3] + getPointCoordinates(0,lighty,0); + + glLoadIdentity(); + glTranslatef(screencoords.x,screencoords.y,0); + glDisable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_BLEND); + + glBlendFunc(GL_ONE,GL_ONE); + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,*flaretexture); + + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + float sizey=8.0/distance*staticlightflarebrightnesses[lightnumber]; + float sizex=sizey*height/width; + + if (distance>0.5){ + glBegin(GL_QUADS); + glColor3f(staticlightflarebrightnesses[lightnumber],staticlightflarebrightnesses[lightnumber],staticlightflarebrightnesses[lightnumber]); + + glTexCoord2f(0.0, 0.0); + glVertex2f(-sizex,sizey); + + glTexCoord2f(0.0, 1.0); + glVertex2f(-sizex,-sizey); + + glTexCoord2f(1.0, 1.0); + glVertex2f( sizex,-sizey); + + glTexCoord2f(1.0, 0.0); + glVertex2f( sizex,sizey); + glEnd(); + } + + glDisable(GL_TEXTURE_2D); + + glDisable(GL_BLEND); + + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity();*/ + + + + glPopMatrix(); + + glEndList(); +} + +void LampAppearance::draw(void){ + glCallList(gllist); +} \ No newline at end of file diff --git a/src/legoblocks.h b/src/legoblocks.h new file mode 100644 index 0000000..e16631f --- /dev/null +++ b/src/legoblocks.h @@ -0,0 +1,145 @@ +/* + * $Id: legoblocks.h,v 1.14 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: legoblocks.h,v $ + * Revision 1.14 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.13 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.12 2002/07/17 20:32:47 msell + * Detail-optio toimii + * + * Revision 1.11 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * Revision 1.10 2002/07/16 00:42:43 msell + * Uusia skyboxeja ja areenan säätöä + * + * Revision 1.9 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.8 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.7 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.6 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.5 2002/06/17 20:49:04 msell + * free -> SDL_FreeSurface + * + * Revision 1.4 2002/06/05 18:39:05 msell + * Jotain pientä + * + * Revision 1.3 2002/06/05 15:00:41 msell + * Palikoihin lisää detailia, facet jaetaan halutun kokosiin osiin + * + * Revision 1.2 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.1 2002/06/03 23:06:38 msell + * no message + * + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __LEGOBLOCKS_H_INCLUDED__ +#define __LEGOBLOCKS_H_INCLUDED__ + +//#include "mesh.h" +#include "object.h" +#include "material.h" +#include "mesh.h" + +#define BLOCKHEIGHT 0.4 + +class BasicBlock : public MeshObject{ +private: + int width, height, depth; + +public: + BasicBlock(int width, int height, int depth); + + void setColor(float red, float green, float blue); +}; + + +class BasicBlockAppearance : public Appearance{ +private: + int width, height, depth; + int gllist; + +protected: + bool usematerial; + +public: + float displacement[3]; + + BasicBlockAppearance(int width, int height, int depth); + + virtual void prepare(void); + virtual void draw(void); +}; + +void drawDetailRectangle(float width, float height); + +extern int knobgllist; +extern int knobdetail; +void initKnob(void); +void createKnob(int knobsegments = -1); + + + +class HeadAppearance : public Appearance{ +private: + int gllist; + +public: + HeadAppearance(void); + + void prepare(void); + void draw(void); +}; + + + +#define FLOWER_RED 1 +#define FLOWER_YELLOW 2 +#define FLOWER_WHITE 3 + +class FlowerAppearance : public Appearance{ +private: + int gllist; + int color1, color2, color3; + +public: + FlowerAppearance(int color1, int color2, int color3); + + void prepare(void); + void draw(void); +}; + + + +class LampAppearance : public Appearance{ +private: + int gllist; + +public: + LampAppearance(void); + + void prepare(void); + void draw(void); +}; + + +#endif diff --git a/src/legoman.cpp b/src/legoman.cpp new file mode 100644 index 0000000..1a971fc --- /dev/null +++ b/src/legoman.cpp @@ -0,0 +1,1110 @@ +/* + * $Id: legoman.cpp,v 1.26 2002/07/22 12:07:36 msell Exp $ + * + * + * $Log: legoman.cpp,v $ + * Revision 1.26 2002/07/22 12:07:36 msell + * Pää kiinni + * + * Revision 1.25 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.24 2002/07/21 22:50:39 msell + * no message + * + * Revision 1.23 2002/07/21 20:14:28 msell + * no message + * + * Revision 1.22 2002/07/21 16:37:00 msell + * no message + * + * Revision 1.21 2002/07/21 15:12:16 msell + * Äänet enabloitu :) + * + * Revision 1.20 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.19 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.18 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.17 2002/07/17 22:45:54 msell + * Ääniä vähän + * + * Revision 1.16 2002/07/16 19:52:09 jkaarlas + * kämmenet hienosäädetty + * + * Revision 1.15 2002/07/16 07:27:32 jkaarlas + * nyt latautuu kämmen. paikka ja väri pitää vielä säätää + * + * Revision 1.14 2002/07/16 00:42:43 msell + * Uusia skyboxeja ja areenan säätöä + * + * Revision 1.13 2002/07/15 22:03:23 msell + * MultiAppearance + * + * Revision 1.12 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.11 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.10 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.9 2002/07/11 18:33:58 jkaarlas + * mallit paikoillaan, vaatii säätöä + * + * Revision 1.8 2002/07/10 22:22:53 msell + * Cartoon-rendaus + * + * Revision 1.7 2002/07/10 21:17:02 msell + * Ukon geometrian viilausta + * + * Revision 1.6 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.5 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.4 2002/07/08 18:28:47 msell + * Törmäystä ja ukkoja + * + * Revision 1.3 2002/07/07 23:21:11 msell + * Pientä parantelua + * + * Revision 1.2 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.1 2002/07/07 17:53:21 msell + * Legoukon alku + * + * + * + * $Date: 2002/07/22 12:07:36 $ + * + */ + +#include "main.h" + +#include + +#include "legoman.h" +#include "object.h" +#include "sphere.h" +#include "world.h" +#include "legoblocks.h" +#include "vector.h" +#include "collision.h" +#include "objectfactory.h" +#include "utils.h" +#include "particle.h" +#include "fight.h" +#include "glapi.h" + + + + +BodyPart::BodyPart(Legoman *parent, float strength){ + this->parent = parent; + this->strength = strength; + reset(); +} + +void BodyPart::reset(void){ + this->energy = 1; + this->attached = true; + this->immortal = 0; + vectorSet(position, 0, 0, 0); + vectorSet(momentum, 0, 0, 0); + matrixIdentity(rotation); + vectorSet(angularmomentum, 0, 0, 0); +} + +void BodyPart::move(void){ + if (immortal > 0) immortal--; + Object::move(); +} + +void BodyPart::hitForce(float speed, float *speed2, Object *source){ + if (parent->isHarmfulObject(source)){ + float tolerance = 0.3; + if (speed > tolerance){ + Sound *sound; + sound = hitsound1; + float volume = (speed-tolerance)*0.4; + if (volume > 1) volume = 1; + volume = 1; + sound->setVolume(volume); + sound->play(30 + random(120)); + + int i; + for (i = 0; i < (int)(speed-0.5); i++){ + float vel[3] = {randomf(2)-1, randomf(3), randomf(2)-1}; + vectorAdd(vel, speed2); + createBlood(position, vel); + } + + //makeDamage(0.1); + if (this == parent->head && source == parent->opponent->head){ + speed *= 0.1; + } + makeDamage(speed*0.1); + } + } else{ + Object::hitForce(speed, speed2, source); + } +} + +void BodyPart::makeDamage(float amount){ + if (strength == 0) return; + if (energy == 0) return; + if (!parent->opponent->isAlive()) return; + if (immortal > 0) return; + + energy -= amount/strength; + if (energy < 0) energy = 0; + if (energy == 0){ + parent->releasePart(this); + } + immortal = 30; +} + + +Sensor::Sensor(){ +} + +void Sensor::attach(Object *object, float *relativeposition){ + vectorCopy(this->relativeposition, relativeposition); + this->object = object; + update(); + update(); + update(); + update(); +} + +void Sensor::attach(Object *object){ + float position[3] = {0, 0, 0}; + attach(object, position); +} + +void Sensor::update(void){ + vectorCopy(oldposition, position); + vectorCopy(oldvelocity, velocity); + + object->transformPoint(position, relativeposition); + + vectorSub(velocity, position, oldposition); + vectorSub(acceleration, velocity, oldvelocity); + + //printf("V: %f, %f, %f\n", velocity[0], velocity[1], velocity[2]); +} + +void Sensor::getPosition(float *target){ + vectorCopy(target, position); +} + +void Sensor::getVelocity(float *target){ + vectorCopy(target, velocity); +} + +void Sensor::getAcceleration(float *target){ + vectorCopy(target, acceleration); +} + +//float rightHandOffset[3] = {-0.60, 0.45, 0.0}; +float rightHandOffset[3] = {-0.40, 0.45, 0.0}; +//float leftHandOffset[3] = {0.60, 0.46, 0.0}; +float leftHandOffset[3] = {0.40, 0.46, 0.0}; +//float leftPalmOffset[3] = {0.28, -0.3, -0.38}; +float leftPalmOffset[3] = {0.08, -0.3, -0.38}; +//float rightPalmOffset[3] = {-0.30, -0.3, -0.38}; +float rightPalmOffset[3] = {-0.10, -0.3, -0.38}; +float waistOffset[3] = {0.0, 0.2, 0.0}; +float rightLegOffset[3] = {-0.15, 0.4, 0.0}; +float leftLegOffset[3] = {0.1, 0.4, 0.0}; + +Legoman::Legoman(int side){ + this->side = side; + + int collisiongroup, collisiongrouphand; + if (side == PLAYER1){ + collisiongroup = COLLISIONGROUP_MAN1; + collisiongrouphand = COLLISIONGROUP_MAN1HAND; + } + if (side == PLAYER2){ + collisiongroup = COLLISIONGROUP_MAN2; + collisiongrouphand = COLLISIONGROUP_MAN2HAND; + } + + float torsocolor[3], legcolor[3]; + + if (side == PLAYER1){ + vectorSet(torsocolor, 1, 0, 0); + vectorSet(legcolor, 0, 0, 1); + } else if (side == PLAYER2){ + vectorSet(torsocolor, 0, 0, 1); + vectorSet(legcolor, 1, 0, 0); + } + + //Legs + Mesh* geomLegMesh = createBox(-0.45, 0.45, -BLOCKHEIGHT*LEGHEIGHT/2.0, BLOCKHEIGHT*LEGHEIGHT/2.0, -0.5, 0.5); + float tmpScale = 1.0; + + //Left leg + { + leftleg = new BodyPart(this, 8); + Mesh* leftLegMesh = loadAscModel((char*)LEFTLEGASC, MODELSCALE, leftLegOffset); + MeshShape *leftLegGeom = new MeshShape(leftleg, geomLegMesh); + leftleg->geometry = leftLegGeom; + leftleg->appearance = new MeshAppearance(leftLegMesh); + //leftleg->appearance = new MeshAppearance(geomLegMesh); + leftleg->appearance->material.setColor(legcolor[0], legcolor[1], legcolor[2], 1); + vectorSet(leftleg->position, -0.6, BLOCKHEIGHT*(LEGHEIGHT/2.0), 0); + leftleg->setGravity(true); + leftleg->setMass(LEGHEIGHT/3.0); + leftleg->setCollisionGroup(collisiongroup); + } + + //Right leg + { + rightleg = new BodyPart(this, 8); + Mesh* rightLegMesh = loadAscModel((char*)RIGHTLEGASC, MODELSCALE, rightLegOffset); + MeshShape *rightLegGeom = new MeshShape(rightleg, geomLegMesh); + rightleg->geometry = rightLegGeom; + rightleg->appearance = new MeshAppearance(rightLegMesh); + //rightleg->appearance = new MeshAppearance(geomLegMesh); + rightleg->appearance->material.setColor(legcolor[0], legcolor[1], legcolor[2], 1); + vectorSet(rightleg->position, 0.6, BLOCKHEIGHT*(LEGHEIGHT/2.0), 0); + rightleg->setGravity(true); + rightleg->setMass(LEGHEIGHT/3.0); + rightleg->setCollisionGroup(collisiongroup); + } + + + //Waist + { + waist = new BodyPart(this, 0); + Mesh* waistMesh = loadAscModel((char*)WAISTASC, MODELSCALE, waistOffset); + MeshAppearance* waistappearance = new MeshAppearance(waistMesh); + waistappearance->material.setColor(0, 1, 0, 1); + + Mesh *waistGeomMesh = createBox(-1 + 0.1, 1 - 0.1, 0, BLOCKHEIGHT*WAISTHEIGHT/2.0, 0.1, 0.4); + MeshShape *waistgeometry = new MeshShape(waist, waistGeomMesh); + waist->geometry = waistgeometry; + waist->appearance = waistappearance; + //waist->appearance = new MeshAppearance(waistGeomMesh); + vectorSet(waist->position, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT/2.0), 0); + waist->setGravity(true); + waist->setMass(2*WAISTHEIGHT/3.0); + waist->setCollisionGroup(collisiongroup); + } + + + //Torso + { + torso = new BodyPart(this, 4); + Mesh* torsoMesh = loadAscModel((char*)TORSOASC, TORSOSCALE); + //int i; + //for (i = 0; i < torsoMesh->polygoncount; i++) torsoMesh->polygons[i].smooth = false; + MeshAppearance* torsoAppearance = new MeshAppearance(torsoMesh); + torsoAppearance->material.setColor(torsocolor[0], torsocolor[1], torsocolor[2], 1); + Mesh *torsoGeomMesh = createBox(-1, 1, -BLOCKHEIGHT*TORSOHEIGHT/2.0, BLOCKHEIGHT*TORSOHEIGHT/2.0, -0.5, 0.5); + MeshShape *torsogeometry = new MeshShape(torso, torsoGeomMesh); + torso->geometry = torsogeometry; + torso->appearance = torsoAppearance; + //torso->appearance = new MeshAppearance(torsoGeomMesh); + vectorSet(torso->position, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT/2.0), 0); + torso->setGravity(true); + torso->setMass(2*TORSOHEIGHT/3.0); + torso->setCollisionGroup(collisiongroup); + } + + + //Hands + //Mesh *handMeshGeom = createBox(-0.4, 0.4, -BLOCKHEIGHT*HANDHEIGHT/2.0, BLOCKHEIGHT*HANDHEIGHT/2.0, -0.5, 0.5); + Mesh *handMeshGeom = createBox(-0.2, 0.2, -BLOCKHEIGHT*HANDHEIGHT/2.0, BLOCKHEIGHT*HANDHEIGHT/2.0, -0.5, 0.5); + + + //Left hand + { + lefthand = new BodyPart(this, 5); + + Mesh* leftHandMesh = loadAscModel((char*)LEFTARMASC, MODELSCALE, leftHandOffset); + Mesh* leftPalmMesh = loadAscModel((char*)LEFTPALMASC, MODELSCALE, leftPalmOffset); + MultiAppearance *a = new MultiAppearance(); + Appearance *arm = new MeshAppearance(leftHandMesh); + Appearance *palm = new MeshAppearance(leftPalmMesh); + arm->material.setColor(torsocolor[0], torsocolor[1], torsocolor[2], 1); + palm->material.setColor(1, 1, 0, 1); + a->addAppearance(arm); + a->addAppearance(palm); + MeshShape *lefthandgeometry = new MeshShape(lefthand, handMeshGeom); + lefthand->geometry = lefthandgeometry; + lefthand->appearance = a;//new MeshAppearance(leftHandMesh); + //lefthand->appearance = new MeshAppearance(handMeshGeom); + //lefthand->appearance->material.setColor(1, 0, 0, 1); + vectorSet(lefthand->position, -1.3, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT - HANDHEIGHT/2.0), 0); + lefthand->setGravity(true); + lefthand->setMass(HANDHEIGHT/3.0); + lefthand->setCollisionGroup(collisiongrouphand); + } + + //Right hand + { + righthand = new BodyPart(this, 5); + Mesh* rightHandMesh = loadAscModel((char*)RIGHTARMASC, MODELSCALE, rightHandOffset); + Mesh* rightPalmMesh = loadAscModel((char*)RIGHTPALMASC, MODELSCALE, rightPalmOffset); + MultiAppearance *a = new MultiAppearance(); + Appearance *arm = new MeshAppearance(rightHandMesh); + arm->material.setColor(torsocolor[0], torsocolor[1], torsocolor[2], 1); + Appearance *palm = new MeshAppearance(rightPalmMesh); + palm->material.setColor(1, 1, 0, 1); + a->addAppearance(arm); + a->addAppearance(palm); + MeshShape *righthandgeometry = new MeshShape(righthand, handMeshGeom); + righthand->geometry = righthandgeometry; + righthand->appearance = a; + //righthand->appearance = new MeshAppearance(handMeshGeom); + vectorSet(righthand->position, 1.3, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT - HANDHEIGHT/2.0), 0); + righthand->setGravity(true); + righthand->setMass(HANDHEIGHT/3.0); + righthand->setCollisionGroup(collisiongrouphand); + } + + + //Head + { + head = new BodyPart(this, 2); + Appearance *headappearance = new HeadAppearance(); + float r = BLOCKHEIGHT*HEADHEIGHT/2; + /*SphereAppearance *headappearance = new SphereAppearance(); + headappearance->setRadius(r); + headappearance->material.setColor(1, 1, 0, 1);*/ + SphereShape *headgeometry = new SphereShape(head); + headgeometry->setRadius(r); + head->geometry = headgeometry; + head->appearance = headappearance; + vectorSet(head->position, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT + HEADHEIGHT/2 + 0.5), 0); + head->setGravity(true); + head->setMass(4.0/3*PI*r*r*r); + head->setCollisionGroup(collisiongroup); + } + + + headsensor = new Sensor(); + torsosensor = new Sensor(); + + + + headvisual = new DamageVisual(head, damageHead, false, + -0.5, -2, 0.5, -1); + + torsovisual = new DamageVisual(torso, damageTorso, false, + -0.5, -1, 0.5, 0); + + lefthandvisual = new DamageVisual(lefthand, damageHand, true, + 0.4, -1, 0.9, 0); + + righthandvisual = new DamageVisual(righthand, damageHand, true, + -0.4, -1, -0.9, 0); + + leftlegvisual = new DamageVisual(leftleg, damageLeg, true, + 0, 0, 0.5, 1); + + rightlegvisual = new DamageVisual(rightleg, damageLeg, true, + -0, 0, -0.5, 1); + + + harmfulobjects = NULL; + + + walkphase = 0; + jumpphase = 0; + hitside = 0; + + alive = true; +} + +void Legoman::insertToWorld(World *world){ + this->world = world; + + + world->addChild(rightleg); + world->addChild(leftleg); + world->addChild(waist); + world->addChild(torso); + world->addChild(lefthand); + world->addChild(righthand); + world->addChild(head); + float linkpoint[3]; + + vectorSet(linkpoint, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT + HEADHEIGHT), 0); + headlinks[0] = world->addLink(head, torso, linkpoint); + + vectorSet(linkpoint, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT), 0); + headlinks[1] = world->addLink(head, torso, linkpoint); + + vectorSet(linkpoint, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT + HEADHEIGHT*0.5), 1); + headlinks[2] = world->addLink(head, torso, linkpoint); + + head->attached = true; + + + vectorSet(linkpoint, -1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT) - 0.5, 0); + lefthandlinks[0] = world->addLink(torso, lefthand, linkpoint); + + vectorSet(linkpoint, -2, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT) - 0.5, 0); + lefthandlinks[1] = world->addLink(torso, lefthand, linkpoint); + + lefthand->attached = true; + + + vectorSet(linkpoint, 1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT) - 0.5, 0); + righthandlinks[0] = world->addLink(torso, righthand, linkpoint); + + vectorSet(linkpoint, 2, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT) - 0.5, 0); + righthandlinks[1] = world->addLink(torso, righthand, linkpoint); + + righthand->attached = true; + + + vectorSet(linkpoint, -1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT), -0.5); + world->addLink(torso, waist, linkpoint); + + vectorSet(linkpoint, 1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT), -0.5); + world->addLink(torso, waist, linkpoint); + + vectorSet(linkpoint, -1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT), 0.5); + world->addLink(torso, waist, linkpoint); + + vectorSet(linkpoint, 1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT), 0.5); + world->addLink(torso, waist, linkpoint); + + waist->attached = true; + + + vectorSet(linkpoint, -1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT)-0.5, 0); + leftleglinks[0] = world->addLink(waist, leftleg, linkpoint); + + vectorSet(linkpoint, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT)-0.5, 0); + leftleglinks[1] = world->addLink(waist, leftleg, linkpoint); + + lll = leftleglinks[1]; + + leftleg->attached = true; + + + vectorSet(linkpoint, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT)-0.5, 0); + rightleglinks[0] = world->addLink(waist, rightleg, linkpoint); + + vectorSet(linkpoint, 1, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT)-0.5, 0); + rightleglinks[1] = world->addLink(waist, rightleg, linkpoint); + + rll = rightleglinks[0]; + + rightleg->attached = true; + + + leftleglinks[2] = world->addLink(waist, leftleg, NULL); + leftleglink = leftleglinks[2]; + leftleglink->enabled = false; + rightleglinks[2] = world->addLink(waist, rightleg, NULL); + rightleglink = rightleglinks[2]; + rightleglink->enabled = false; + + lefthandlinks[2] = world->addLink(torso, lefthand, NULL); + lefthandlink = lefthandlinks[2]; + lefthandlink->enabled = false; + righthandlinks[2] = world->addLink(torso, righthand, NULL); + righthandlink = righthandlinks[2]; + righthandlink->enabled = false; +} + +void Legoman::heal(void){ + headlinks[0]->enabled = true; + headlinks[1]->enabled = true; + headlinks[2]->enabled = true; + lefthandlinks[0]->enabled = true; + lefthandlinks[1]->enabled = true; + lefthandlinks[2]->enabled = true; + righthandlinks[0]->enabled = true; + righthandlinks[1]->enabled = true; + righthandlinks[2]->enabled = true; + leftleglinks[0]->enabled = true; + leftleglinks[1]->enabled = true; + leftleglinks[2]->enabled = true; + rightleglinks[0]->enabled = true; + rightleglinks[1]->enabled = true; + rightleglinks[2]->enabled = true; + + leftleglink->enabled = false; + rightleglink->enabled = false; + lefthandlink->enabled = false; + righthandlink->enabled = false; + + leftleg->reset(); + rightleg->reset(); + waist->reset(); + torso->reset(); + lefthand->reset(); + righthand->reset(); + head->reset(); + vectorSet(leftleg->position, -0.6, BLOCKHEIGHT*(LEGHEIGHT/2.0), 0); + vectorSet(rightleg->position, 0.6, BLOCKHEIGHT*(LEGHEIGHT/2.0), 0); + vectorSet(waist->position, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT/2.0), 0); + vectorSet(torso->position, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT/2.0), 0); + vectorSet(lefthand->position, -1.3, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT - HANDHEIGHT/2.0), 0); + vectorSet(righthand->position, 1.3, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT - HANDHEIGHT/2.0), 0); + vectorSet(head->position, 0, BLOCKHEIGHT*(LEGHEIGHT + WAISTHEIGHT + TORSOHEIGHT + HEADHEIGHT/2 + 0.5), 0); + + headsensor->attach(head); + torsosensor->attach(torso); + + alive = true; +} + +void Legoman::lockPart(int part){ + if (part & LEFTLEG && leftleg->energy > 0){ + float linkpoint[3]; + vectorScale(linkpoint, &leftleg->rotation[3], -1); + //vectorAdd(linkpoint, leftleg->position); + vectorAdd(linkpoint, waist->position); + vectorAdd(linkpoint, lll->point1); + world->renewLink(leftleglink, linkpoint); + } + if (part & RIGHTLEG && rightleg->energy > 0){ + float linkpoint[3]; + vectorScale(linkpoint, &rightleg->rotation[3], -1); + //vectorAdd(linkpoint, rightleg->position); + vectorAdd(linkpoint, waist->position); + vectorAdd(linkpoint, rll->point1); + world->renewLink(rightleglink, linkpoint); + } + if (part & LEFTHAND && lefthand->energy > 0){ + float linkpoint[3]; + vectorScale(linkpoint, &lefthand->rotation[3], -1); + vectorAdd(linkpoint, lefthand->position); + world->renewLink(lefthandlink, linkpoint); + } + if (part & RIGHTHAND && righthand->energy > 0){ + float linkpoint[3]; + vectorScale(linkpoint, &righthand->rotation[3], -1); + vectorAdd(linkpoint, righthand->position); + world->renewLink(righthandlink, linkpoint); + } + + headsensor->attach(head); + torsosensor->attach(torso); +} + +void Legoman::addHarmfulObject(Object *object){ + objectlist *node = new objectlist(); + node->object = object; + node->next = harmfulobjects; + harmfulobjects = node; +} + +bool Legoman::isHarmfulObject(Object *object){ + objectlist *node = harmfulobjects; + while (node != NULL){ + if (node->object == object) return true; + node = node->next; + } + return false; +} + +float Legoman::getInvMass(void){ + float mass = torso->getMass() + waist->getMass(); + if (head->attached) mass += head->getMass(); + if (lefthand->attached) mass += lefthand->getMass(); + if (righthand->attached) mass += righthand->getMass(); + if (leftleg->attached) mass += leftleg->getMass(); + if (rightleg->attached) mass += rightleg->getMass(); + return 1.0/mass; +} + +void Legoman::addOpponent(Legoman *opponent){ + this->opponent = opponent; + opponent->addHarmfulObject(head); + opponent->addHarmfulObject(lefthand); + opponent->addHarmfulObject(righthand); + opponent->addHarmfulObject(leftleg); + opponent->addHarmfulObject(rightleg); +} + +void Legoman::unlockPart(int part){ + if (part & LEFTLEG){ + leftleglink->enabled = false; + } + if (part & RIGHTLEG){ + rightleglink->enabled = false; + } + if (part & LEFTHAND){ + lefthandlink->enabled = false; + } + if (part & RIGHTHAND){ + righthandlink->enabled = false; + } +} + +void Legoman::move(float *movement){ + vectorAdd(leftleg->position, movement); + vectorAdd(rightleg->position, movement); + vectorAdd(waist->position, movement); + vectorAdd(torso->position, movement); + vectorAdd(lefthand->position, movement); + vectorAdd(righthand->position, movement); + vectorAdd(head->position, movement); +} + +#define LEGSPEED 0.03 + +#define BALANCEANGLE (PI/12) + +void Legoman::balance(void){ + if (!alive || !head->attached) return; + + float headpos[3], torsopos[3]; + headsensor->getPosition(headpos); + torsosensor->getPosition(torsopos); + float posdiff[3]; + vectorSub(posdiff, headpos, torsopos); + float posdifflen = vectorLength(posdiff); + float angle = acos(posdiff[1]/posdifflen); + + float headtarget[3]; + vectorSet(headtarget, 0, posdifflen, 0); + vectorAdd(headtarget, torsopos); + + float force[3]; + vectorSub(force, headtarget, headpos); + + float headvel[3], torsovel[3]; + headsensor->getVelocity(headvel); + torsosensor->getVelocity(torsovel); + float veldiff[3]; + vectorSub(veldiff, headvel, torsovel); + vectorScale(veldiff, 50); + + vectorSaturate(veldiff, 0, 10); + + vectorSub(force, veldiff); + + if (angle < BALANCEANGLE){ + vectorScale(force, pow(1-angle/BALANCEANGLE, 0.1)); + vectorScale(force, 100); + head->addExternalForce(force); + } + + if (walkdelay == 0){ + if (walkphase > 0){ + walkphase --; + updateLegs(); + } + } + + vectorScale(lefthand->angularmomentum, 0.98); + vectorScale(righthand->angularmomentum, 0.98); +} + +void Legoman::update(void){ + if (walkdelay > 0){ + walkdelay--; + } + + /*if (jumpphase > 0){ + jumpphase--; + }*/ + if (torso->momentum[1] < 0 && isOnGround()){ + jumpphase--; + if (jumpphase == 0) jumpenabled = true; + } + + if (hitside < 10) hitside += 2; + //hitside = -hitside; + /*if (hitside > 0){ + hitside = -hitside; + }/* else{ + hitside = 0; + }*/ + + if (alive){ + if (head->position[1] < 0){// && torso->momentum[1] < 0){ + fallOff(); + } + + headsensor->update(); + torsosensor->update(); + + balance(); + } +} + +void Legoman::updateLegs(void){ + float temp[3]; + float angle; + + walkphase = sfmod(walkphase, PI/LEGSPEED); + + //Left leg + angle = sfmod(walkphase*LEGSPEED, PI); + if (angle > PI/4) angle = PI/2 - angle; + if (angle < -PI/4) angle = -PI/2 - angle; + vectorSet(temp, 0, -cos(angle), -sin(angle)); + vectorAdd(temp, lll->point1); + vectorCopy(leftleglink->point1, temp); + + //Right leg + angle = sfmod(walkphase*LEGSPEED + PI/2, PI); + if (angle > PI/4) angle = PI/2 - angle; + if (angle < -PI/4) angle = -PI/2 - angle; + vectorSet(temp, 0, -cos(angle), -sin(angle)); + vectorAdd(temp, rll->point1); + vectorCopy(rightleglink->point1, temp); +} + +void Legoman::walk(float amount){ + walkdelay = 20; + + float sign; + if (amount > 0) sign = 1; + else sign = -1; + + walkphase += sign; + + updateLegs(); + + if (!isStanding()) return; + + float movement[3]; + float xdir[3], ydir[3], zdir[3]; + + //vectorScale(ydir, &torso->rotation[3], 1); + vectorSet(ydir, 0, 1, 0); + vectorScale(zdir, &torso->rotation[6], -1); + vectorCross(xdir, ydir, zdir); + vectorNormalize(xdir); + //vectorScale(xdir, &torso->rotation[0], 1); + + float oldmomentum[3]; + vectorCopy(oldmomentum, torso->momentum); + + float xmove[3], ymove[3], zmove[3]; + + vectorProject(xmove, oldmomentum, xdir); + vectorProject(ymove, oldmomentum, ydir); + vectorProject(zmove, oldmomentum, zdir); + + vectorScale(xmove, 0.5); + float wh = waist->position[1]; + if (wh < WAISTHEIGHT + 1.0){ + float hd = WAISTHEIGHT + 1.0 - wh; + vectorScale(ymove, ydir, hd*10); + } + float newz[3]; + vectorScale(newz, zdir, 6*sign); + float ztemp[3]; + vectorProject(ztemp, newz, ydir); + vectorSub(newz, ztemp); + vectorScale(newz, 0.8); + vectorScale(zmove, 0.2); + vectorAdd(zmove, newz); + + vectorCopy(movement, xmove); + vectorAdd(movement, ymove); + vectorAdd(movement, zmove); + + //if (isStanding() && isOnGround()) + + vectorCopy(torso->momentum, movement); + vectorScale(movement, torso->invmass*waist->getMass()); + vectorCopy(waist->momentum, movement); + + + /*float speed = vectorDot(oldmomentum, movement); + float speedadd = 1; + float maxspeed = 5; + /*speed += speedadd; + if (speed > maxspeed) speed = maxspeed; + if (speed + speedadd > maxspeed){ + speedadd = maxspeed - speed; + } + + vectorScale(movement, speedadd); + if (waist->position[1] < WAISTHEIGHT + 1.0){ + movement[1] = 3; + } + vectorAdd(torso->momentum, movement);*/ + + /*float proj[3]; + vectorProject(proj, oldmomentum, movement); + float len = vectorLength(proj); + vectorAdd(movement, proj); + vectorSaturate(movement, 0, + + movement[1] = 300; + //torso->addExternalForce(movement); + }*/ + + /*float linkpoint[3]; + vectorScale(linkpoint, &leftleg->rotation[3], -1); + vectorAdd(linkpoint, leftleg->position);*/ + + /*float movement[3]; + float temp[3]; + vectorScale(temp, &torso->rotation[3], amount*0.1); + vectorScale(movement, &torso->rotation[6], amount); + vectorAdd(movement, temp); + + if (walkphase == 0){ + walkphase = 40; + vectorAdd(leftleg->momentum, movement); + } + if (walkphase == 20){ + walkphase = 19; + vectorAdd(rightleg->momentum, movement); + }*/ + + /*float axis[3]; + vectorScale(axis, &leftleg->rotation[0], amount); + + if (walkphase == 0){ + //walkphase = 40; + vectorAdd(leftleg->angularmomentum, axis); + vectorAdd(rightleg->angularmomentum, axis); + }*/ + /*if (walkphase == 0){ + walkphase = 1; + vectorAdd(rightleg->momentum, movement); + }*/ + /*float axis[3]; + float movement[3]; + + if (walkphase == 0){ + unlockPart(LEFTLEG); + + vectorScale(axis, &leftleg->rotation[0], 5); + vectorAdd(leftleg->angularmomentum, axis); + + float temp[3]; + vectorScale(temp, &torso->rotation[6], -10); + vectorScale(movement, &torso->rotation[3], 5); + vectorAdd(movement, temp); + vectorAdd(torso->momentum, movement); + vectorAdd(leftleg->momentum, movement); + + walkphase = 40; + }*/ +} + +void Legoman::turn(float amount){ + float axis[3]; + if (isStanding()){ + vectorScale(axis, &torso->rotation[3], amount); + vectorCopy(torso->angularmomentum, axis); + } else{ + vectorScale(axis, &torso->rotation[3], amount*0.3); + vectorAdd(torso->angularmomentum, axis); + } +} + +void Legoman::hit(void){ + if (!lefthand->attached && !righthand->attached) return; + /*float leftdot = vectorDot(&lefthand->rotation[3], &torso->rotation[6]); + float rightdot = vectorDot(&righthand->rotation[3], &torso->rotation[6]); + if (leftdot < rightdot){ + hitside = LEFTHAND; + } else{ + hitside = RIGHTHAND; + }*/ + + if (hitside >= 10) hitside -= 9; + else hitside -= 2; + + if ((hitside & 1) && !lefthand->attached) hitside++; + if (!(hitside & 1) && !righthand->attached) hitside++; + + float axis[3]; + if (hitside & 1){ + vectorScale(axis, &lefthand->rotation[0], 20); + vectorCopy(lefthand->angularmomentum, axis); + } else{ + vectorScale(axis, &righthand->rotation[0], 20); + vectorCopy(righthand->angularmomentum, axis); + } +} + +void Legoman::jump(void){ + if (!leftleg->attached && !rightleg->attached) return; + if (jumpenabled){// == 0 && isOnGround()){ + float r = BLOCKHEIGHT*HEADHEIGHT/2; + float strength = (2*LEGHEIGHT + 2*WAISTHEIGHT + 2*TORSOHEIGHT + + 2*HANDHEIGHT + 4.0*PI*r*r*r)/3.0*getInvMass(); + float jumpvector[3] = {0, 100.0/strength, 0}; + + //vectorCopy(torso->momentum, jumpvector); + torso->momentum[1] = jumpvector[1]; + head->momentum[1] = 0;// jumpvector[1]; + waist->momentum[1] = 0;// jumpvector[1]; + leftleg->momentum[1] = 0;// jumpvector[1]; + rightleg->momentum[1] = 0;// jumpvector[1]; + lefthand->momentum[1] = 0;// jumpvector[1]; + righthand->momentum[1] = 0;// jumpvector[1]; + //vectorSet(head->momentum, 0, 0, 0); + //jumpphase = 150; + jumpsound->play(); + jumpenabled = false; + } + jumpphase = 2; +} + +bool Legoman::isOnGround(void){ + //if (!isStanding()) return false; + float wh = waist->position[1]; + if (wh > WAISTHEIGHT + 1.5) return false; + if (fabs(torso->momentum[1]) > 10) return false; + //if (fabs(head->momentum[1]) > 10) return false; + //if (fabs(waist->momentum[1]) > 3) return false; + return true; +} + +bool Legoman::isStanding(void){ + if (!leftleg->attached && !rightleg->attached) return false; + float headpos[3], torsopos[3]; + headsensor->getPosition(headpos); + torsosensor->getPosition(torsopos); + float posdiff[3]; + vectorSub(posdiff, headpos, torsopos); + float posdifflen = vectorLength(posdiff); + float angle = acos(posdiff[1]/posdifflen); + + if (angle < BALANCEANGLE) return true; + else return false; +} + +void Legoman::fallOff(void){ + if (dead) return; + if (rand()&1) fallsound1->play(); + else fallsound2->play(); + die(); + head->energy = 0; + torso->energy = 0; + lefthand->energy = 0; + righthand->energy = 0; + waist->energy = 0; + leftleg->energy = 0; + rightleg->energy = 0; +} + +void Legoman::releasePart(BodyPart *part){ + if (dead) return; + if (part == head){ + headlinks[0]->enabled = false; + headlinks[1]->enabled = false; + headlinks[2]->enabled = false; + head->attached = false; + //float move[3]; + //vectorScale(move, &head->rotation[3], 1); + //vectorAdd(head->position, move); + die(); + } else if (part == lefthand){ + lefthandlinks[0]->enabled = false; + lefthandlinks[1]->enabled = false; + lefthandlinks[2]->enabled = false; + lefthand->attached = false; + } else if (part == righthand){ + righthandlinks[0]->enabled = false; + righthandlinks[1]->enabled = false; + righthandlinks[2]->enabled = false; + righthand->attached = false; + } else if (part == leftleg){ + leftleglinks[0]->enabled = false; + leftleglinks[1]->enabled = false; + leftleglinks[2]->enabled = false; + leftleg->attached = false; + } else if (part == rightleg){ + rightleglinks[0]->enabled = false; + rightleglinks[1]->enabled = false; + rightleglinks[2]->enabled = false; + rightleg->attached = false; + } else if (part == torso){ + die(); + } + if (!lefthand->attached && !righthand->attached && + !leftleg->attached && !rightleg->attached) die(); +} + +void Legoman::die(void){ + if (dead) return; + alive = false; + lll->enabled = false; + rll->enabled = false; + gameOver(this); +} + +bool Legoman::isAlive(void){ + return alive; +} + +Legoman *Legoman::getOpponent(void){ + return opponent; +} + +void Legoman::drawVisuals(void){ + headvisual->draw(); + torsovisual->draw(); + lefthandvisual->draw(); + righthandvisual->draw(); + leftlegvisual->draw(); + rightlegvisual->draw(); +} + + + +DamageVisual::DamageVisual(BodyPart *object, Texture *texture, bool mirror, + float x1, float y1, float x2, float y2){ + this->object = object; + this->texture = texture; + + this->x1 = x1; + this->y1 = y1; + this->x2 = x2; + this->y2 = y2; + + float d = 3.0/512; + + if (mirror){ + this->tx1 = 1-d; + this->tx2 = 0+d+0.01; + } else{ + this->tx1 = 0+d+0.01; + this->tx2 = 1-d; + } + this->ty1 = 0+d; + this->ty2 = 1-d; +} + +void DamageVisual::draw(void){ + float energy = object->energy; + texture->enable(); + + glBegin(GL_QUADS); + if (energy > 0) glColor3f(1-energy, energy, 0); + else glColor3f(0.3, 0.3, 0.3); + + glTexCoord2f(tx1, ty1); + glVertex2f(x1, y1); + + glTexCoord2f(tx1, ty2); + glVertex2f(x1, y2); + + glTexCoord2f(tx2, ty2); + glVertex2f(x2, y2); + + glTexCoord2f(tx2, ty1); + glVertex2f(x2, y1); + glEnd(); +} diff --git a/src/legoman.h b/src/legoman.h new file mode 100644 index 0000000..36bad38 --- /dev/null +++ b/src/legoman.h @@ -0,0 +1,271 @@ +/* + * $Id: legoman.h,v 1.21 2002/07/22 12:07:36 msell Exp $ + * + * + * $Log: legoman.h,v $ + * Revision 1.21 2002/07/22 12:07:36 msell + * Pää kiinni + * + * Revision 1.20 2002/07/22 06:08:18 msell + * Filenimet pienellä + * + * Revision 1.19 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.18 2002/07/21 22:50:39 msell + * no message + * + * Revision 1.17 2002/07/21 20:14:28 msell + * no message + * + * Revision 1.16 2002/07/21 15:16:41 msell + * no message + * + * Revision 1.15 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.14 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.13 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.12 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.11 2002/07/17 22:45:54 msell + * Ääniä vähän + * + * Revision 1.10 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.9 2002/07/16 07:27:32 jkaarlas + * nyt latautuu kämmen. paikka ja väri pitää vielä säätää + * + * Revision 1.8 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.7 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.6 2002/07/11 18:33:58 jkaarlas + * mallit paikoillaan, vaatii säätöä + * + * Revision 1.5 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.4 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.3 2002/07/08 18:28:47 msell + * Törmäystä ja ukkoja + * + * Revision 1.2 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.1 2002/07/07 17:53:21 msell + * Legoukon alku + * + * + * + * $Date: 2002/07/22 12:07:36 $ + * + */ + +#ifndef __LEGOMAN_H_INCLUDED__ +#define __LEGOMAN_H_INCLUDED__ + +class BodyPart; +class Sensor; +class Legoman; +class DamageVisual; + +#include "object.h" +#include "world.h" + +#define LEGHEIGHT 4 +#define WAISTHEIGHT 1 +#define TORSOHEIGHT 4 +#define HANDHEIGHT 6 +#define HEADHEIGHT 3 + +#define PLAYER1 1 +#define PLAYER2 2 + +#define LEFTLEG 1 +#define RIGHTLEG 2 +#define LEFTHAND 4 +#define RIGHTHAND 8 + + +const char LEFTLEGASC[] = DATAPATH"blockolegscaled.asc"; +const char RIGHTLEGASC[] = DATAPATH"blockolegscaled.asc"; +const char WAISTASC[] = DATAPATH"blockowaistscaled.asc"; +const char TORSOASC[] = DATAPATH"blockotorsoscaled.asc"; +const char LEFTARMASC[] = DATAPATH"leftarm.asc"; +const char RIGHTARMASC[] = DATAPATH"rightarm.asc"; +const char LEFTPALMASC[] = DATAPATH"leftpalm.asc"; +const char RIGHTPALMASC[] = DATAPATH"rightpalm.asc"; + + +#define MODELSCALE 0.12 +#define TORSOSCALE 0.115 + + +class BodyPart : public Object{ +private: + float energy; + float strength; + Legoman *parent; + + bool attached; + + int immortal; + +public: + BodyPart(Legoman *parent, float strength); + + void move(void); + + void hitForce(float speed, float *speed2, Object *source); + + void makeDamage(float amount); + + void reset(void); + + friend class DamageVisual; + friend class Legoman; +}; + +class Sensor{ +private: + float relativeposition[3]; + Object *object; + + float position[3], oldposition[3]; + float velocity[3], oldvelocity[3]; + float acceleration[3]; + +public: + Sensor(); + + void attach(Object *object, float *relativeposition); + void attach(Object *object); + void update(void); + + void getPosition(float *target); + void getVelocity(float *target); + void getAcceleration(float *target); +}; + +class Legoman{ +private: + int side; + + bool alive; + + BodyPart *head; + BodyPart *torso; + BodyPart *waist; + BodyPart *lefthand, *righthand; + BodyPart *leftleg, *rightleg; + + DamageVisual *headvisual; + DamageVisual *torsovisual; + DamageVisual *lefthandvisual, *righthandvisual; + DamageVisual *leftlegvisual, *rightlegvisual; + + ObjectLink *leftleglink, *rightleglink; + ObjectLink *lefthandlink, *righthandlink; + ObjectLink *lll, *rll; + + ObjectLink *leftleglinks[3], *rightleglinks[3]; + ObjectLink *lefthandlinks[3], *righthandlinks[3]; + ObjectLink *headlinks[3]; + + objectlist *harmfulobjects; + + Legoman *opponent; + + Sensor *headsensor, *torsosensor; + + int walkphase, walkdelay; + int jumpphase; + int hitside; + + bool jumpenabled; + int hitcounter; + + World *world; + + void balance(void); + void updateLegs(void); + bool isStanding(void); + bool isOnGround(void); + float getInvMass(void); + + void fallOff(void); + void releasePart(BodyPart *part); + void die(void); + +public: + Legoman(int side); + + void insertToWorld(World *world); + void heal(void); + + void addHarmfulObject(Object *object); + bool isHarmfulObject(Object *object); + + void addOpponent(Legoman *opponent); + + //Call once per frame + void update(void); + + //Lock both legs at the same time by calling + //lockLeg(LEFTLEG | RIGHTLEG); + void lockPart(int part); + void unlockPart(int part); + + //Relative movement + void move(float *movement); + + void turn(float amount); + void walk(float amount); + + void jump(void); + void hit(void); + + bool isAlive(void); + Legoman *getOpponent(void); + + void drawVisuals(); + + friend class BodyPart; + friend void drawEnd(int framecount); +}; + + + +extern Texture *damageHead; +extern Texture *damageTorso; +extern Texture *damageHand; +extern Texture *damageLeg; + + +class DamageVisual{ +private: + BodyPart *object; + float x1, y1, x2, y2; + float tx1, ty1, tx2, ty2; + Texture *texture; + +public: + DamageVisual(BodyPart *object, Texture *texture, bool mirror, + float x1, float y1, float x2, float y2); + + void draw(void); +}; + +#endif + diff --git a/src/light.cpp b/src/light.cpp new file mode 100644 index 0000000..20fdbbe --- /dev/null +++ b/src/light.cpp @@ -0,0 +1,218 @@ +/* + * $Id: light.cpp,v 1.5 2002/07/15 20:32:35 msell Exp $ + * + * + * $Log: light.cpp,v $ + * Revision 1.5 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.4 2002/06/17 20:49:05 msell + * free -> SDL_FreeSurface + * + * Revision 1.3 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.2 2002/06/03 23:20:43 msell + * no message + * + * Revision 1.1 2002/05/18 12:29:35 msell + * Valot ja äänijärjestelmän parantelua + * + * + * + * $Date: 2002/07/15 20:32:35 $ + * + */ + +#include "main.h" + +#include "light.h" +#include "camera.h" +#include "vector.h" +#include "glapi.h" + +static int glnextlightnum = 0; + +static Light *lights[GL_MAX_LIGHTS]; + +Light::Light(void){ + setPosition(0, 0, 0); + setColor(1, 1, 1); + setSpecular(0, 0, 0); + setAttenuation(1, 0, 0); + setEnabled(false); + glnum = GL_LIGHT0 + glnextlightnum; + lights[glnextlightnum] = this; + glnextlightnum++; +} + +void Light::setPosition(float x, float y, float z){ + position[0] = x; + position[1] = y; + position[2] = z; + position[3] = 1; +} + +void Light::setDirection(float x, float y, float z){ + position[0] = -x; + position[1] = -y; + position[2] = -z; + position[3] = 0; +} + +void Light::setColor(float red, float green, float blue){ + diffuse[0] = red; + diffuse[1] = green; + diffuse[2] = blue; + diffuse[3] = 1; + glLightfv(glnum, GL_DIFFUSE, diffuse); +} + +void Light::setSpecular(float red, float green, float blue){ + specular[0] = red; + specular[1] = green; + specular[2] = blue; + specular[3] = 1; + glLightfv(glnum, GL_SPECULAR, specular); +} + +void Light::setAttenuation(float constant, float linear, float quadratic){ + attenuation[0] = constant; + attenuation[1] = linear; + attenuation[2] = quadratic; + glLightf(glnum, GL_CONSTANT_ATTENUATION, attenuation[0]); + glLightf(glnum, GL_LINEAR_ATTENUATION, attenuation[1]); + glLightf(glnum, GL_QUADRATIC_ATTENUATION, attenuation[2]); +} + +void Light::setEnabled(bool enabled){ + this->enabled = enabled; + if (enabled) glEnable(glnum); + else glDisable(glnum); +} + +void Light::glUpdate(void){ + glLightfv(glnum, GL_POSITION, position); +} + +extern Camera camera; + + +void Light::createFlare(void){ + glPushMatrix(); + + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + + int width = viewport[2]; + int height = viewport[3]; + + glTranslatef(position[0], position[1], position[2]); + + GLboolean lightingenabled = glIsEnabled(GL_LIGHTING); + glDisable(GL_LIGHTING); + + /*float cx=cameratarget.x-cameraposition.x; + float cy=cameratarget.y-cameraposition.y; + float cz=cameratarget.z-cameraposition.z; + float len=sqrt(cx*cx+cy*cy+cz*cz); + cx/=len; + cy/=len; + cz/=len;*/ + float dir[3]; + float cameratarget[3], cameraposition[3]; + camera.getTarget(cameratarget); + camera.getPosition(cameraposition); + vectorSub(dir, cameratarget, cameraposition); + vectorNormalize(dir); + + float dir2[3]; + vectorSub(dir2, position, cameraposition); + float distance = vectorDot(dir2, dir); + + /*float xd=(staticlightpositions[lightnumber].x-cameraposition.x)*cx; + float yd=(staticlightpositions[lightnumber].y-cameraposition.y)*cy; + float zd=(staticlightpositions[lightnumber].z-cameraposition.z)*cz; + float distance=xd+yd+zd;*/ + + + float screencoords[3]; + /*GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + + int width=viewport[2]; + int height=viewport[3];*/ + + GLdouble modelviewm[16], projectionm[16]; + glGetDoublev(GL_MODELVIEW_MATRIX, modelviewm); + glGetDoublev(GL_PROJECTION_MATRIX, projectionm); + + GLdouble wx,wy,wz; + if (gluProject(0, 0, 0, modelviewm, projectionm, viewport, &wx, &wy, &wz) == GL_FALSE){ + printf("Failure\n"); + } + + screencoords[0] = (float)(2*wx-width)/width; + screencoords[1] = (float)(2*wy-height)/height; + screencoords[2] = wz; + + + //getPointCoordinates(screencoords); + //point3d screencoords = getPointCoordinates(0, 0, 0); + + glLoadIdentity(); + glTranslatef(screencoords[0], screencoords[1], 0); + glDisable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_BLEND); + + glBlendFunc(GL_ONE,GL_ONE); + //glEnable(GL_TEXTURE_2D); + //glBindTexture(GL_TEXTURE_2D, flaretexture->getId()); + + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + float sizey = 6.0/distance * 1.0;//staticlightflarebrightnesses[lightnumber]; + float sizex = sizey * height/width; + + if (distance>0.5){ + glBegin(GL_QUADS); + //glColor3f(staticlightflarebrightnesses[lightnumber],staticlightflarebrightnesses[lightnumber],staticlightflarebrightnesses[lightnumber]); + glColor3fv(diffuse); + + glTexCoord2f(0.0, 0.0); + glVertex2f(-sizex,sizey); + + glTexCoord2f(0.0, 1.0); + glVertex2f(-sizex,-sizey); + + glTexCoord2f(1.0, 1.0); + glVertex2f( sizex,-sizey); + + glTexCoord2f(1.0, 0.0); + glVertex2f( sizex,sizey); + glEnd(); + } + + //glDisable(GL_TEXTURE_2D); + + glDisable(GL_BLEND); + + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + if (lightingenabled) glEnable(GL_LIGHTING); + glEnable(GL_DEPTH_TEST); + + glPopMatrix(); +} + +void updateLights(void){ + int i; + for (i = 0; i < glnextlightnum; i++){ + Light *light = lights[i]; + light->glUpdate(); + } +} \ No newline at end of file diff --git a/src/light.h b/src/light.h new file mode 100644 index 0000000..1fdc0b2 --- /dev/null +++ b/src/light.h @@ -0,0 +1,56 @@ +/* + * $Id: light.h,v 1.5 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: light.h,v $ + * Revision 1.5 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.4 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.3 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.2 2002/06/03 23:20:43 msell + * no message + * + * Revision 1.1 2002/05/18 12:29:35 msell + * Valot ja äänijärjestelmän parantelua + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __LIGHT_H_INCLUDED__ +#define __LIGHT_H_INCLUDED__ + +class Light{ +private: + float position[4]; + float diffuse[4]; + float specular[4]; + float attenuation[3]; + bool enabled; + int glnum; + +public: + //Creates DISABLED light + Light(void); + + void setPosition(float x, float y, float z); + void setDirection(float x, float y, float z); + void setColor(float red, float green, float blue); + void setSpecular(float red, float green, float blue); + void setAttenuation(float constant, float linear, float quadratic); + void setEnabled(bool enabled); + void glUpdate(void); + void createFlare(void); +}; + +void updateLights(void); + +#endif + diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..de1052b --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,248 @@ +/* + * $Id: main.cpp,v 1.30 2002/07/21 15:03:12 msell Exp $ + * + * + * $Log: main.cpp,v $ + * Revision 1.30 2002/07/21 15:03:12 msell + * Äänet disabloitu + * + * Revision 1.29 2002/07/19 20:39:31 msell + * Linux-porttausta + * + * Revision 1.28 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.27 2002/07/19 20:06:32 msell + * Linux-porttausta + * + * Revision 1.26 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.25 2002/07/19 12:42:44 msell + * Loading... + * + * Revision 1.24 2002/07/19 12:28:29 msell + * 2D-mode + * + * Revision 1.23 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.22 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.21 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * Revision 1.20 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.19 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.18 2002/07/11 18:33:30 jkaarlas + * turhat äänet pois + * + * Revision 1.17 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.16 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.15 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.14 2002/06/17 20:49:05 msell + * free -> SDL_FreeSurface + * + * Revision 1.13 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.12 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.11 2002/06/15 22:56:37 msell + * Säätöä + * + * Revision 1.10 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * Revision 1.9 2002/06/07 21:16:51 msell + * Fysiikkaenginen alkua + * + * Revision 1.8 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * Revision 1.7 2002/05/19 13:40:19 msell + * Säätöä + * + * Revision 1.6 2002/05/18 12:29:35 msell + * Valot ja äänijärjestelmän parantelua + * + * Revision 1.5 2002/05/17 23:13:30 msell + * Valot + * + * Revision 1.4 2002/05/16 18:41:16 msell + * Vektorifunctioita ja kamera + * + * Revision 1.3 2002/05/15 21:07:23 msell + * Äänisäätöä + * + * Revision 1.2 2002/05/15 15:21:00 msell + * Äänisäätöä + * + * Revision 1.1 2002/05/15 14:36:39 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/21 15:03:12 $ + * + */ + +#include "main.h" + +#include +#include +#include +#ifdef WIN32 +#include +#endif + +#include "audio.h" +#include "run.h" +#include "texture.h" +#include "fight.h" +#include "font.h" +#include "3dutils.h" + +#include "glapi.h" + +int screenwidth=1024; +int screenheight=768; +int screenbpp; + +void exitProgram(int code){ + SDL_Quit(); + //uninitAudio(); + exit(code); +} + +void changeResolution(int width, int height, bool fullscreen){ + int mode = SDL_OPENGL; + if (fullscreen) mode |= SDL_FULLSCREEN; + if (!SDL_SetVideoMode(width, height, screenbpp, mode)){ + fprintf(stderr,"Couldn't set %i*%i*%i opengl video mode: %s\n",screenwidth,screenheight,screenbpp,SDL_GetError()); + exitProgram(-1); + } + + setupOpengl(width, height); + + screenwidth = width; + screenheight = height; + + if (fullscreen) SDL_ShowCursor(SDL_DISABLE); + else SDL_ShowCursor(SDL_ENABLE); + + initScenes(); +} + + +bool keys[SDLK_LAST] = {false}; + +void handleKeydown(SDL_keysym *keysym){ + keys[keysym->sym] = true; +} + + +void handleKeyup(SDL_keysym *keysym){ + keys[keysym->sym] = false; +} + +void processEvents(void){ + SDL_Event event; + while (SDL_PollEvent(&event)){ + switch (event.type){ + case SDL_KEYDOWN: + handleKeydown(&event.key.keysym); + break; + case SDL_KEYUP: + handleKeyup(&event.key.keysym); + break; + case SDL_VIDEORESIZE: + screenwidth=event.resize.w; + screenheight=event.resize.h; + setupOpengl(screenwidth,screenheight); + break; + case SDL_QUIT: + exitProgram(0); + break; + } + } +} + +int getTime(void){ +#ifdef WIN32 + return timeGetTime(); +#else + return SDL_GetTicks(); +#endif +} + +int main(int argc, char *argv[]){ + //printf("Initializing SDL.\n"); + + if ((SDL_Init(SDL_INIT_VIDEO)==-1)){ + printf("Could not initialize SDL: %s.\n",SDL_GetError()); + exitProgram(-1); + } + + const SDL_VideoInfo *info=SDL_GetVideoInfo(); + if (!info){ + printf("Could not get video info with SDL: %s.\n",SDL_GetError()); + exitProgram(-1); + } + screenbpp=info->vfmt->BitsPerPixel; + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + + + atexit(SDL_Quit); + + SDL_WM_SetCaption("BlockoFighter 2",NULL); + + initAudio(); + + changeResolution(screenwidth, screenheight, false); + + //printf("SDL initialized.\n"); + + + + double calculatefps = 200.0; + int framecounter, oldframecounter = 0; + int currenttime; + int framesdrawn=0; + int skipframes; + int starttime = getTime(); + + while (1){ + do{ + currenttime = getTime()-starttime; + framecounter = calculatefps*currenttime/1000.0; + } while (oldframecounter == framecounter); + skipframes = framecounter - oldframecounter; + for (; skipframes > 0; skipframes--){ + calculateFrame(++oldframecounter); + } + //calculateFrame(oldframecounter++); + processEvents(); + drawFrame(framecounter); + framesdrawn++; + } + return 0; +} \ No newline at end of file diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..41fffbf --- /dev/null +++ b/src/main.h @@ -0,0 +1,78 @@ +/* + * $Id: main.h,v 1.13 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: main.h,v $ + * Revision 1.13 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.12 2002/07/19 20:06:32 msell + * Linux-porttausta + * + * Revision 1.11 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.10 2002/07/16 17:16:34 msell + * Fontit ja valikot + * + * Revision 1.9 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.8 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.7 2002/07/08 22:53:38 msell + * Säätöä + * + * Revision 1.6 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.5 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.4 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.3 2002/05/17 12:30:26 msell + * no message + * + * Revision 1.2 2002/05/16 18:41:16 msell + * Vektorifunctioita ja kamera + * + * Revision 1.1 2002/05/15 14:36:39 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __MAIN_H_INCLUDED__ +#define __MAIN_H_INCLUDED__ + + +#ifdef WIN32 +#pragma warning(disable:4244) //Disable: conversion from 'double' to 'double', possible loss of data +#pragma warning(disable:4305) //Disable: truncation from 'const double' to 'double' +#endif + +#include + +#define DATAPATH "data/" +extern bool keys[SDLK_LAST]; + +void exitProgram(int code); +void changeResolution(int width, int height, bool fullscreen); +extern int screenwidth, screenheight; + +extern int debugcounter; +#ifdef DEBUG +#define DP printf("%s: %i (Debug counter: %i)\n",__FILE__,__LINE__,debugcounter++); +#else +#define DP +#endif + +#endif + diff --git a/src/material.cpp b/src/material.cpp new file mode 100644 index 0000000..5ee6909 --- /dev/null +++ b/src/material.cpp @@ -0,0 +1,98 @@ +/* + * $Id: material.cpp,v 1.10 2002/07/19 20:40:44 msell Exp $ + * + * + * $Log: material.cpp,v $ + * Revision 1.10 2002/07/19 20:40:44 msell + * Linux-porttausta + * + * Revision 1.9 2002/07/10 22:22:04 jkaarlas + * getColor + * + * Revision 1.8 2002/06/27 21:43:29 jkaarlas + * lisätty setTexture-funktio + * + * Revision 1.7 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.6 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.5 2002/06/19 22:45:29 jkaarlas + * nyt nämä menee järkevästi + * + * Revision 1.4 2002/06/17 20:49:05 msell + * free -> SDL_FreeSurface + * + * Revision 1.3 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * + * + * $Date: 2002/07/19 20:40:44 $ + * + */ + +#include "main.h" + +#include "material.h" +#include "glapi.h" +#include "graphics.h" + +Material::Material(void){ + setColor(1, 1, 1, 1); + this->texture = new Texture; +} + +bool Material::loadTexture(char *path){ + if (!this->texture){ + this->texture = new Texture; + } + if (this->texture->loadImage(path)){ + setColor(1, 1, 1, 1); + return true; + } + return false; +} + +void Material::freeTexture(void){ + this->texture->~Texture(); +} + +void Material::setColor(float red, float green, float blue, float alpha){ + color[0] = red; + color[1] = green; + color[2] = blue; + color[3] = alpha; +} + +const float* Material::getColor(void){ + return color; +} + +void Material::enable(void){ + enabled = true; + glColor4fv(color); + this->texture->enable(); +} + +void Material::disable(void){ + enabled = false; + this->texture->disable(); +} + +bool Material::isEnabled(void){ + return enabled; +} + +Texture* Material::getTexture(void){ + return this->texture; +} + +void Material::setTexture(Texture* tex){ + //this->texture->~Texture; + this->texture = tex; +} diff --git a/src/material.h b/src/material.h new file mode 100644 index 0000000..0a99c2d --- /dev/null +++ b/src/material.h @@ -0,0 +1,61 @@ +/* + * $Id: material.h,v 1.8 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: material.h,v $ + * Revision 1.8 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.7 2002/07/10 22:22:04 jkaarlas + * getColor + * + * Revision 1.6 2002/06/27 21:43:29 jkaarlas + * lisätty setTexture-funktio + * + * Revision 1.5 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.4 2002/06/19 22:45:29 jkaarlas + * nyt nämä menee järkevästi + * + * Revision 1.3 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __MATERIAL_H_INCLUDED__ +#define __MATERIAL_H_INCLUDED__ + +#include +#include "texture.h" + +class Material{ +private: + Texture* texture; + float color[4]; + bool enabled; + +public: + Material(void); + bool loadTexture(char *path); + void freeTexture(void); + + void setColor(float red, float green, float blue, float alpha); + const float* getColor(void); + void enable(void); + void disable(void); + bool isEnabled(void); + Texture* getTexture(void); + void setTexture(Texture* tex); + +}; + +#endif + diff --git a/src/menu.cpp b/src/menu.cpp new file mode 100644 index 0000000..03fc042 --- /dev/null +++ b/src/menu.cpp @@ -0,0 +1,900 @@ +/* + * $Id: menu.cpp,v 1.14 2002/07/22 01:14:14 msell Exp $ + * + * + * $Log: menu.cpp,v $ + * Revision 1.14 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.13 2002/07/21 22:50:39 msell + * no message + * + * Revision 1.12 2002/07/21 20:14:28 msell + * no message + * + * Revision 1.11 2002/07/21 16:37:00 msell + * no message + * + * Revision 1.10 2002/07/19 22:38:37 msell + * Pingviini + * + * Revision 1.9 2002/07/19 14:05:52 msell + * Damagetextuurit näkyy + * + * Revision 1.8 2002/07/19 12:28:29 msell + * 2D-mode + * + * Revision 1.7 2002/07/19 12:10:53 msell + * Hups + * + * Revision 1.6 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.5 2002/07/17 22:45:54 msell + * Ääniä vähän + * + * Revision 1.4 2002/07/17 20:32:47 msell + * Detail-optio toimii + * + * Revision 1.3 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.2 2002/07/16 18:55:16 msell + * Äänet valikkoon + * + * Revision 1.1 2002/07/16 17:16:35 msell + * Fontit ja valikot + * + * + * + * $Date: 2002/07/22 01:14:14 $ + * + */ + +#include "main.h" + +#include + +#include "legoblocks.h" +#include "camera.h" +#include "light.h" +#include "audio.h" +#include "object.h" +#include "appearance.h" +#include "sphere.h" +#include "vector.h" +#include "collision.h" +#include "utils.h" +#include "graphics.h" +#include "objectfactory.h" +#include "world.h" +#include "3dutils.h" +#include "legoman.h" +#include "font.h" +#include "run.h" +#include "menu.h" +#include "fight.h" + +#include "glapi.h" + +Camera titlecamera; +Light titlelight; +World *titleworld; + +Sound *changesound; +Sound *selectsound; +Sound *menumusic; + +bool menuinitialized = false; + +void initMenu(void){ + if (!menuinitialized){ + titleworld = new World(); + } + + titlelight.setColor(1, 1, 1); + titlelight.setSpecular(1, 1, 1); + titlelight.setPosition(-0.5, BLOCKHEIGHT*16, 0.5); + titlelight.setAttenuation(0.0, 0.0, 0.01); + + if (!menuinitialized){ + Object *lamp; + lamp = new Object(); + lamp->appearance = new LampAppearance(); + lamp->setPosition(-0.5, BLOCKHEIGHT*15.5, 0.5); + titleworld->addChild(lamp); + + + //Floor + BasicBlock *floorblock; + + floorblock = new BasicBlock(33, 1, 5); + floorblock->setPosition(-0.5, -BLOCKHEIGHT/2.0 + BLOCKHEIGHT*(4*3+1), 0.5-5); + floorblock->setColor(0, 1, 0); + titleworld->addChild(floorblock); + + floorblock = new BasicBlock(41, 1, 10); + floorblock->setPosition(8.5-5, -BLOCKHEIGHT/2.0, 0.5-2.5); + floorblock->setColor(0, 1, 0); + titleworld->addChild(floorblock); + + floorblock = new BasicBlock(1, 4*3, 1); + floorblock->setPosition(-14.5, BLOCKHEIGHT*4*3/2.0, 0.5-5); + floorblock->setColor(1, 0, 0); + titleworld->addChild(floorblock); + + floorblock = new BasicBlock(1, 4*3, 1); + floorblock->setPosition(13.5, BLOCKHEIGHT*4*3/2.0, 0.5-5); + floorblock->setColor(1, 0, 0); + titleworld->addChild(floorblock); + + + + + //Letters + + //B + /*int Bsize = 8; + int Bwidth = 5; + int Bletter[8][4] = { + {0, 0, 4, 1}, + {0, 4, 3, 1}, + {0, 8, 4, 1}, + {0, 1, 1, 7}, + //{3, 1, 2, 1}, + {2, 3, 3, 1}, + {2, 5, 3, 1}, + //{3, 7, 2, 1}, + {4, 0, 1, 3}, + {4, 6, 1, 3}};*/ + int Bsize = 10; + int Bwidth = 5; + int Bletter[10][4] = { + {0, 0, 4, 1}, + {0, 4, 4, 1}, + {0, 8, 4, 1}, + {0, 1, 1, 7}, + {3, 1, 2, 1}, + {3, 3, 2, 1}, + {3, 5, 2, 1}, + {3, 7, 2, 1}, + {4, 2, 1, 1}, + {4, 6, 1, 1}}; + + //l + int lsize = 2; + int lwidth = 4; + int lletter[2][4] = { + {0, 0, 4, 1}, + {0, 1, 1, 4}}; + + //o + int osize = 4; + int owidth = 4; + int oletter[4][4] = { + {0, 0, 4, 1}, + {0, 4, 4, 1}, + {0, 1, 1, 3}, + {3, 1, 1, 3}}; + + //c + int csize = 5; + int cwidth = 4; + int cletter[5][4] = { + {0, 0, 4, 1}, + {0, 4, 4, 1}, + {0, 1, 1, 3}, + {3, 1, 1, 1}, + {3, 3, 1, 1}}; + /* {1, 0, 2, 1}, + {1, 4, 2, 1}, + {0, 1, 1, 3}, + {3, 1, 1, 1}, + {3, 3, 1, 1}};*/ + + //k + int ksize = 6; + int kwidth = 4; + int kletter[6][4] = { + {0, 0, 1, 5}, + {1, 2, 2, 1}, + {2, 1, 2, 1}, + {2, 3, 2, 1}, + {3, 0, 1, 1}, + {3, 4, 1, 1}}; + /* {0, 0, 1, 5}, + {1, 2, 1, 1}, + {2, 1, 1, 1}, + {2, 3, 1, 1}, + {3, 0, 1, 1}, + {3, 4, 1, 1}};*/ + + //F + int Fsize = 3; + int Fwidth = 3; + int Fletter[3][4] = { + {0, 0, 1, 7}, + {0, 4, 3, 1}, + {0, 7, 6, 1}}; + + //i + int isize = 1; + int iwidth = 1; + int iletter[1][4] = { + {0, 0, 1, 4}}; + + //g + int gsize = 5; + int gwidth = 4; + int gletter[5][4] = { + {0, 0, 4, 1}, + {0, 4, 4, 1}, + {0, 1, 1, 3}, + {3, 1, 1, 1}, + {2, 2, 2, 1}}; + + //h + int hsize = 3; + int hwidth = 1; + int hletter[3][4] = { + {0, 0, 1, 5}, + {3, 0, 1, 5}, + {0, 2, 4, 1}}; + + //t + int tsize = 2; + int twidth = 4; + int tletter[2][4] = { + {3, 0, 1, 6}, + {0, 6, 7, 1}}; + + //e + int esize = 5; + int ewidth = 4; + int eletter[5][4] = { + {0, 0, 4, 1}, + {0, 4, 4, 1}, + {0, 2, 3, 1}, + {0, 1, 1, 1}, + {0, 3, 1, 1}}; + + //r + int rsize = 6; + int rwidth = 4; + int rletter[6][4] = { + {0, 0, 1, 5}, + {0, 2, 3, 1}, + {0, 4, 3, 1}, + {2, 1, 2, 1}, + {3, 0, 1, 1}, + {2, 3, 2, 1}}; + /*int rsize = 5; + int rwidth = 4; + int rletter[5][4] = { + {0, 0, 1, 5}, + {0, 2, 3, 1}, + {0, 4, 3, 1}, + {3, 0, 1, 2}, + {3, 3, 1, 1}};*/ + + #define LETTERCOUNT 6 + int lettersizes[LETTERCOUNT] = { + Bsize, + lsize, + osize, + csize, + ksize, + osize + }; + int letterwidths[LETTERCOUNT] = { + Bwidth, + lwidth, + owidth, + cwidth, + kwidth, + owidth + }; + int *letters[LETTERCOUNT] = { + &Bletter[0][0], + &lletter[0][0], + &oletter[0][0], + &cletter[0][0], + &kletter[0][0], + &oletter[0][0] + }; + + #define LETTERCOUNT2 7 + int lettersizes2[LETTERCOUNT2] = { + Fsize, + isize, + gsize, + hsize, + tsize, + esize, + rsize + }; + int letterwidths2[LETTERCOUNT2] = { + Fwidth, + iwidth, + gwidth, + hwidth, + twidth, + ewidth, + rwidth + }; + int *letters2[LETTERCOUNT2] = { + &Fletter[0][0], + &iletter[0][0], + &gletter[0][0], + &hletter[0][0], + &tletter[0][0], + &eletter[0][0], + &rletter[0][0] + }; + BasicBlock *letterblock; + + float z = 0.5; + int i, j; + int dx = -15; + int dy = BLOCKHEIGHT*(4*3+1); + int dz = -5; + for (i = 0; i < LETTERCOUNT; i++){ + int size = lettersizes[i]; + int width = letterwidths[i]; + for (j = 0; j < size; j++){ + int x = letters[i][j*4+0]; + int y = letters[i][j*4+1]*3; + int w = letters[i][j*4+2]; + int h = letters[i][j*4+3]*3; + letterblock = new BasicBlock(w, h, 1); + letterblock->setPosition(dx+x+w/2.0, dy+BLOCKHEIGHT*(y+h/2.0), dz+z + randomf(0.1)); + letterblock->setColor(1, 0.5, 1); + titleworld->addChild(letterblock); + } + dx += width + 1; + } + dx = -5; + dy = 0; + dz = 0; + for (i = 0; i < LETTERCOUNT2; i++){ + int size = lettersizes2[i]; + int width = letterwidths2[i]; + for (j = 0; j < size; j++){ + int x = letters2[i][j*4+0]; + int y = letters2[i][j*4+1]*3; + int w = letters2[i][j*4+2]; + int h = letters2[i][j*4+3]*3; + letterblock = new BasicBlock(w, h, 1); + letterblock->setPosition(dx+x+w/2.0, dy+BLOCKHEIGHT*(y+h/2.0), dz+z + randomf(0.1)); + //float rotate[3] = {0, randomf(0.1), 0}; + //matrixCreateRotation(letterblock->rotation, rotate); + letterblock->setColor(1, 0.5, 1); + titleworld->addChild(letterblock); + } + dx += width + 1; + } + + + + Object *flower; + + flower = new Object(); + flower->appearance = new FlowerAppearance(FLOWER_RED, FLOWER_WHITE, FLOWER_YELLOW); + flower->setPosition(-7.5, 0, 1.5); + titleworld->addChild(flower); + + flower = new Object(); + flower->appearance = new FlowerAppearance(FLOWER_YELLOW, FLOWER_RED, FLOWER_YELLOW); + flower->setPosition(-11.5, 0, -2.5); + titleworld->addChild(flower); + + flower = new Object(); + flower->appearance = new FlowerAppearance(FLOWER_WHITE, FLOWER_WHITE, FLOWER_RED); + flower->setPosition(-14.5, 0, 0.5); + titleworld->addChild(flower); + + + + changesound = new Sound(DATAPATH"menuchange.wav"); + selectsound = new Sound(DATAPATH"menuselect.wav"); + menumusic = new Sound(DATAPATH"menu.mp3", true); + } + + titleworld->prepare(); + + menuinitialized = true; +} + +#define MODEMAIN 0 +#define MODEOPTIONS 1 + +#define MAINSTART 0 +#define MAINOPTIONS 1 +#define MAINQUIT 2 + +#define OPTIONSRESOLUTION 0 +#define OPTIONSFULLSCREEN 1 +#define OPTIONSDETAIL 2 +#define OPTIONSRETURN 3 + +int menuoption = MAINSTART; +int maxoption; +int menumode = MODEMAIN; +bool pressed = false; + +float obx1, oby1, obx2, oby2; +float bx1, by1, bx2, by2; +float interpolator = 1.0; + +int xres, yres; +int oldresolution; +int resolution = 2; +bool fullscreen = false; +int olddetail; +int detail = 2; + +#define RESOLUTIONCOUNT 6 +int resolutions[RESOLUTIONCOUNT][2] = { + {640, 480}, + {800, 600}, + {1024, 768}, + {1280, 960}, + {1280, 1024}, + {1600, 1200} +}; + +#define DETAILCOUNT 4 +char *details[DETAILCOUNT] = {"Off", "Low", "Medium", "High"}; + +int menurestartcounter = -1; + +void menuRestart(void){ + menurestartcounter = 0; +} + +void menuMain(void){ + interpolator = 0.0; + menumode = MODEMAIN; + menuoption = MAINOPTIONS; + obx1 = bx1; + oby1 = by1; + obx2 = bx2; + oby2 = by2; +} + +float menufade; + +int gamestart = 0; + +bool loading = true; + +void menuStartGame(void){ + menumusic->fadeOut(300); + gamestart = 200; + menurestartcounter = -1; +} + +void menuStartGame2(void){ + titlelight.setEnabled(false); + changeGameMode(FIGHTMODE); + startFight(); + menurestartcounter = -1; +} + +void menuOptions(void){ + interpolator = 0.0; + menumode = MODEOPTIONS; + menuoption = OPTIONSRESOLUTION; + obx1 = bx1; + oby1 = by1; + obx2 = bx2; + oby2 = by2; + oldresolution = resolution; + olddetail = detail; +} + +int quitcounter = -1; + +void menuEscPressed(void){ + menurestartcounter = -1; + //menumusic->stop(); + menumusic->fadeOut(200); + quitcounter = 0; +} + +void menuQuit(void){ + exitProgram(0); +} + + +void menuResolution(int dir){ + resolution += dir; + if (resolution < 0) resolution = 0; + if (resolution >= RESOLUTIONCOUNT) resolution = RESOLUTIONCOUNT-1; + //resolution = (resolution + RESOLUTIONCOUNT) % RESOLUTIONCOUNT; +} + +void calculateMenu(int framecount){ + if (framecount == 1){ + menumusic->setVolume(0); + menumusic->play(); + menumusic->fadeIn(300); + } + if (menurestartcounter != -1){ + menurestartcounter++; + if (menurestartcounter == 300){ + menumusic->play(); + menumusic->fadeIn(100); + menurestartcounter = -1; + } + } + + + menufade = -1; + + titlelight.setEnabled(true); + + if (framecount < 200){ + menufade = 1-framecount/200.0; + } else{ + loading = false; + } + + if (gamestart > 0){ + gamestart--; + if (gamestart == 0){ + menuStartGame2(); + } + menufade = (200-gamestart)/200.0; + } + + if (quitcounter != -1){ + menufade = quitcounter/200.0; + quitcounter++; + if (quitcounter == 200) menuQuit(); + } + + float cameratarget[3] = {0, 0, 0}; + titlecamera.setPosition(sin(framecount*0.001)*2-8, sin(framecount*0.0033)*2+15, cos(framecount*0.001)*2+25); + titlecamera.setTarget(cameratarget); + + titleworld->move(); + + xres = resolutions[resolution][0]; + yres = resolutions[resolution][1]; + + switch(menumode){ + case MODEMAIN: + maxoption = 2; + + bx1 = 0.03; + by1 = 0.49; + bx2 = 0.68; + by2 = 0.96; + + break; + case MODEOPTIONS: + maxoption = 3; + + bx1 = 0.1; + by1 = 0.3; + bx2 = 0.9; + by2 = 0.8; + break; + } + + if (interpolator < 1.0){ + interpolator += 0.02; + } else{ + interpolator = 1.0; + if (menufade == -1){ + if (keys[SDLK_DOWN]){ + if (!pressed){ + /*if (menuoption < maxoption){ + menuoption++; + changesound->play(); + }*/ + menuoption = (menuoption + 1)%(maxoption+1); + changesound->play(); + pressed = true; + } + } else if (keys[SDLK_UP]){ + if (!pressed){ + /*if (menuoption > 0){ + menuoption--; + changesound->play(); + }*/ + menuoption = (menuoption + maxoption)%(maxoption+1); + changesound->play(); + pressed = true; + } + } else if (keys[SDLK_LEFT]){ + if (!pressed){ + switch(menumode){ + case MODEOPTIONS: + switch(menuoption){ + case OPTIONSRESOLUTION: + menuResolution(-1); + break; + case OPTIONSDETAIL: + if (detail > 0) detail--; + break; + } + break; + } + selectsound->play(); + pressed = true; + } + } else if (keys[SDLK_RIGHT]){ + if (!pressed){ + switch(menumode){ + case MODEOPTIONS: + switch(menuoption){ + case OPTIONSRESOLUTION: + menuResolution(1); + break; + case OPTIONSDETAIL: + if (detail < DETAILCOUNT-1) detail++; + break; + } + break; + } + selectsound->play(); + pressed = true; + } + } else if (keys[SDLK_ESCAPE]){ + if (!pressed){ + switch(menumode){ + case MODEMAIN: + if (menuoption != MAINQUIT){ + menuoption = MAINQUIT; + changesound->play(); + } + else menuEscPressed(); + break; + case MODEOPTIONS: + selectsound->play(); + resolution = oldresolution; + detail = olddetail; + menuMain(); + break; + } + pressed = true; + } + } else if (keys[SDLK_RETURN]){ + if (!pressed){ + switch(menumode){ + case MODEMAIN: + switch(menuoption){ + case MAINSTART: + menuStartGame(); + break; + case MAINOPTIONS: + menuOptions(); + break; + case MAINQUIT: + menuEscPressed(); + break; + } + break; + case MODEOPTIONS: + switch(menuoption){ + case OPTIONSRESOLUTION: + if (resolution != oldresolution) changeResolution(xres, yres, fullscreen); + oldresolution = resolution; + break; + case OPTIONSFULLSCREEN: + fullscreen = !fullscreen; + changeResolution(xres, yres, fullscreen); + break; + case OPTIONSDETAIL: + setDetail(detail); + olddetail = detail; + break; + case OPTIONSRETURN: + if (resolution != oldresolution){ + changeResolution(xres, yres, fullscreen); + oldresolution = resolution; + } + if (detail != olddetail){ + setDetail(detail); + olddetail = detail; + } + menuMain(); + break; + } + break; + } + selectsound->play(); + pressed = true; + } + } else pressed = false; + } + } +} + +void drawMenu(int framecount){ + //createSkyBox(0, -20, 0, 400, 200, 400); + createSkyBox(-200, -200, -200, 400, 400, 400); + glLoadIdentity(); + titlecamera.glUpdate(); + + updateLights(); + + + + titleworld->draw(); + + + flaretexture->enable(); + titlelight.createFlare(); + flaretexture->disable(); + + + /*//2D-view + glDisable(GL_LIGHTING); + glDisable(GL_CULL_FACE); + glDisable(GL_DEPTH_TEST); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + gluOrtho2D(0, 1, 1, 0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity();*/ + enable2D(); + + glColor3f(1, 1, 1); + print(0.73, 0.55, + "Programming:\n" \ + " Miika Sell\n" \ + " Juha Kaarlas\n" \ + "\n" \ + "Graphics:\n" \ + " Miika Sell\n" \ + " Juha Kaarlas\n" \ + "\n" \ + "Musics:\n" \ + " Osmand" + , 0.03); + + print(0.35, 0.965, "http://blockofighter.kicks-ass.net/", 0.02); + + print(0.88, 0.96, "Version 2.0", 0.02); + + tuxtexture->enable(); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor3f(1, 1, 1); + + float tuxx = 0.9; + float tuxy = 0.02; + float tuxw = 0.1*3/4; + float tuxh = 0.1; + glBegin(GL_QUADS); + glTexCoord2f(0, 0); + glVertex2f(tuxx, tuxy); + + glTexCoord2f(1, 0); + glVertex2f(tuxx+tuxw, tuxy); + + glTexCoord2f(1, 1); + glVertex2f(tuxx+tuxw, tuxy+tuxh); + + glTexCoord2f(0, 1); + glVertex2f(tuxx, tuxy+tuxh); + glEnd(); + tuxtexture->disable(); + + glColor3f(1, 1, 1); + print(0.88, 0.12, "supported", 0.02); + + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0, 0, 0, 0.5); + float x1, y1, x2, y2; + x1 = (1-interpolator)*obx1 + interpolator*bx1; + y1 = (1-interpolator)*oby1 + interpolator*by1; + x2 = (1-interpolator)*obx2 + interpolator*bx2; + y2 = (1-interpolator)*oby2 + interpolator*by2; + glBegin(GL_QUADS); + glVertex2f(x1, y1); + glVertex2f(x2, y1); + glVertex2f(x2, y2); + glVertex2f(x1, y2); + glEnd(); + + if (interpolator == 1.0){ + switch(menumode){ + case MODEMAIN: + glColor3f(1, 1, 1); + print(0.05, 0.5, "Start game", 0.1); + print(0.05, 0.65, "Options", 0.1); + print(0.05, 0.8, "Quit", 0.1); + + x1 = 0.04; + x2 = 0.67; + switch(menuoption){ + case 0: + y1 = 0.5; + y2 = 0.65; + break; + case 1: + y1 = 0.65; + y2 = 0.79; + break; + case 2: + y1 = 0.79; + y2 = 0.95; + break; + } + break; + case MODEOPTIONS: + glColor3f(1, 1, 1); + char resolutionstring[22]; + sprintf(resolutionstring, "Resolution: %ix%i", xres, yres); + print(0.12, 0.32, resolutionstring, 0.07); + print(0.12, 0.42, "Toggle fullscreen", 0.07); + char detailstring[22]; + sprintf(detailstring, "Detail: %s", details[detail]); + print(0.12, 0.52, detailstring, 0.07); + print(0.12, 0.68, "Save and return", 0.07); + + x1 = 0.11; + x2 = 0.89; + switch(menuoption){ + case 0: + y1 = 0.32; + y2 = 0.42; + break; + case 1: + y1 = 0.42; + y2 = 0.52; + break; + case 2: + y1 = 0.52; + y2 = 0.62; + break; + case 3: + y1 = 0.68; + y2 = 0.78; + break; + } + break; + } + + glLineWidth(2); + + glColor4f(sin(framecount*0.04)*0.4+0.6, sin(framecount*0.04)*0.4+0.6, sin(framecount*0.04)*0.4+0.6, 0.5); + glBegin(GL_LINE_LOOP); + glVertex2f(x1, y1); + glVertex2f(x2, y1); + glVertex2f(x2, y2); + glVertex2f(x1, y2); + glEnd(); + } + + + if (menufade != -1){ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0, 0, 0, menufade); + glBegin(GL_QUADS); + glVertex2f(0, 0); + glVertex2f(1, 0); + glVertex2f(1, 1); + glVertex2f(0, 1); + glEnd(); + if (loading){ + glColor4f(menufade, menufade, menufade, menufade); + print(0.08, 0.4, "Loading...", 0.2); + } + } + + disable2D(); + /*//Back to 3D-view + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW);*/ +} diff --git a/src/menu.h b/src/menu.h new file mode 100644 index 0000000..93e07fa --- /dev/null +++ b/src/menu.h @@ -0,0 +1,48 @@ +/* + * $Id: menu.h,v 1.6 2002/07/21 22:50:39 msell Exp $ + * + * + * $Log: menu.h,v $ + * Revision 1.6 2002/07/21 22:50:39 msell + * no message + * + * Revision 1.5 2002/07/19 21:17:07 msell + * bugifixi + * + * Revision 1.4 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.3 2002/07/19 20:06:32 msell + * Linux-porttausta + * + * Revision 1.2 2002/07/17 20:32:47 msell + * Detail-optio toimii + * + * Revision 1.1 2002/07/16 17:16:35 msell + * Fontit ja valikot + * + * + * + * $Date: 2002/07/21 22:50:39 $ + * + */ + +#ifndef __MENU_H_INCLUDED__ +#define __MENU_H_INCLUDED__ + +#include + +#include "texture.h" +#include "audio.h" + +extern int detail; + +extern Texture *tuxtexture; + +void initMenu(void); +void calculateMenu(int framecount); +void drawMenu(int framecount); +void menuRestart(void); + +#endif + diff --git a/src/mesh.cpp b/src/mesh.cpp new file mode 100644 index 0000000..26a5bff --- /dev/null +++ b/src/mesh.cpp @@ -0,0 +1,433 @@ +/* + * $Id: mesh.cpp,v 1.14 2002/07/19 20:08:28 msell Exp $ + * + * + * $Log: mesh.cpp,v $ + * Revision 1.14 2002/07/19 20:08:28 msell + * Linux-porttausta + * + * Revision 1.13 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.12 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.11 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.10 2002/07/10 22:22:53 msell + * Cartoon-rendaus + * + * Revision 1.9 2002/07/10 22:10:32 jkaarlas + * skaalatut ja käännellyt ruumiinosat + * + * Revision 1.8 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.7 2002/07/07 17:53:21 msell + * Legoukon alku + * + * Revision 1.6 2002/07/07 15:29:07 msell + * Törmäyksien parantelua + * + * Revision 1.5 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.4 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.3 2002/06/26 22:30:29 jkaarlas + * lisätty Vertexiin tekstuurikoordinaatit + * + * Revision 1.2 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.1 2002/06/20 22:50:12 msell + * Meshit + * + * + * + * $Date: 2002/07/19 20:08:28 $ + * + */ + +#include "main.h" + +#include "mesh.h" +#include "vector.h" +#include "sphere.h" +#include "collision.h" +#include "audio.h" + +#include + +#include "glapi.h" + +Vertex::Vertex(void){ + vectorSet(position, 0, 0, 0); + vectorSet(normal, 0, 0, 0); +} + +Vertex::Vertex(float x, float y, float z){ + vectorSet(position, x, y, z); + vectorSet(normal, x, y, z); + vectorNormalize(normal); +} + +Vertex::Vertex(float x, float y, float z, float nx, float ny, float nz){ + vectorSet(position, x, y, z); + vectorSet(normal, nx, ny, nz); +} + +void Vertex::setTexCoords(float u, float v){ + this->texcoords[0] = u; + this->texcoords[1] = v; +} + +Polygon::Polygon(void){ + vertexcount = 0; + edgecount = 0; + smooth = false; + realsmooth = false; +} + + + +Mesh::Mesh(void){ + vertexcount = 0; + polygoncount = 0; + edgecount = 0; +} + +Mesh::~Mesh(void){ + delete [] polygons; + delete [] vertices; +} + +void Mesh::createPlanes(void){ + int i; + for (i = 0; i < polygoncount; i++){ + class Polygon *polygon = &this->polygons[i]; + if (polygon->vertexcount >= 3){ + float v1[3], v2[3]; + vectorSub(v1, polygon->vertices[1]->position, + polygon->vertices[0]->position); + vectorSub(v2, polygon->vertices[2]->position, + polygon->vertices[0]->position); + vectorCross(polygon->planenormal, v1, v2); + vectorNormalize(polygon->planenormal); + + polygon->planedistance = -vectorDot(polygon->vertices[0]->position, polygon->planenormal); + } + } +} + +void Mesh::createVertexnormals(void){ + int i, j, ii; + bool connect; + float normal[3]; + for (i = 0; i < vertexcount; i++){ + bool found = false; + vectorSet(normal, 0, 0, 0); + for (j = 0; j < polygoncount; j++){ + connect = false; + class Polygon *polygon = &polygons[j]; + for (ii = 0;ii < polygon->vertexcount; ii++){ + if (polygons[j].vertices[ii] == &(vertices[i])){ + connect = true; + } + } + if (connect){ + vectorAdd(normal, polygon->planenormal); + found = true; + } + } + if (found){ + vectorNormalize(vertices[i].normal, normal); + } + } + for (j = 0; j < polygoncount; j++){ + class Polygon *polygon = &polygons[j]; + if (!polygon->realsmooth) polygon->smooth = true; + } +} + +void Mesh::createEdges(void){ + int maxedgecount = 0; + int i; + for (i = 0; i < polygoncount; i++){ + class Polygon *polygon = &polygons[i]; + maxedgecount += polygon->vertexcount; + } + + edgecount = 0; + int j, k; + Edge *edges = new Edge[maxedgecount]; + for (i = 0; i < polygoncount; i++){ + class Polygon *polygon = &polygons[i]; + polygon->edges = new Edge *[polygon->vertexcount]; + for (j = 1; j <= polygon->vertexcount; j++){ + Vertex *v1 = polygon->vertices[j-1]; + Vertex *v2 = polygon->vertices[j%polygon->vertexcount]; + + bool found = false; + for (k = 0; k < edgecount; k++){ + if (edges[k].v2 == v1 && edges[k].v1 == v2){ + found = true; + edges[k].p2 = polygon; + break; + } + } + + if (!found){ + edges[edgecount].v1 = v1; + edges[edgecount].v2 = v2; + edges[edgecount].p1 = polygon; + edges[edgecount].p2 = NULL; + edgecount++; + } + } + } + + this->edges = new Edge[edgecount]; + //printf("%i\n", edgecount); + for (i = 0; i < edgecount; i++){ + this->edges[i].v1 = edges[i].v1; + this->edges[i].v2 = edges[i].v2; + this->edges[i].p1 = edges[i].p1; + this->edges[i].p2 = edges[i].p2; + + class Polygon *p; + p = edges[i].p1; + p->edges[p->edgecount++] = &this->edges[i]; + p = edges[i].p2; + p->edges[p->edgecount++] = &this->edges[i]; + //printf("%p, %p\n", edges[i].p1, edges[i].p2); + } + + delete[] edges; +} + + +float Mesh::calculateScale(float targetLength, int axis){ + + float min = 0.0; + float max = 0.0; + + for (int i=0; i < this->vertexcount; i++){ + if (this->vertices->position[axis] > max){ + max = this->vertices->position[axis]; + } + if (this->vertices->position[axis] < min){ + min = this->vertices->position[axis]; + } + } + return fabs(targetLength / (max - min)); +} + +/* ei toimi kunnolla kaikille objekteille (kädet ok, jalat ja torso ei) */ +void Mesh::scale(float targetLength, int axis){ + float newscale = this->calculateScale(targetLength, axis); + this->scale(newscale); +} + +/* ei toimi kunnolla kaikille objekteille (kädet ok, jalat ja torso ei)*/ +void Mesh::scale(float scale){ + for (int i=0; i < this->vertexcount; i++){ + this->vertices->position[0] *= scale; + this->vertices->position[1] *= scale; + this->vertices->position[2] *= scale; + } + this->createVertexnormals(); + this->createPlanes(); +} + +MeshObject::MeshObject(Mesh *mesh){ + this->mesh = mesh; + this->appearance = new MeshAppearance(mesh); + this->geometry = new MeshShape(this); +} + + + +MeshAppearance::MeshAppearance(Mesh *mesh){ + this->mesh = mesh; +} + + + +void MeshAppearance::draw(void){ + //glDisable(GL_CULL_FACE); + glColor4fv(this->material.getColor()); + this->material.enable(); + + int i, j; + + for (i = 0; i < mesh->polygoncount; i++){ + class Polygon *polygon = &mesh->polygons[i]; + + glBegin(GL_TRIANGLE_FAN); + + if (!polygon->smooth) glNormal3fv(polygon->planenormal); + + for (j = 0; j < polygon->vertexcount; j++){ + Vertex *vertex = polygon->vertices[j]; + + if (polygon->smooth) glNormal3fv(vertex->normal); + glVertex3fv(vertex->position); + + } + + + glEnd(); + } + + + glDisable(GL_DEPTH); + glDisable(GL_LIGHTING); + glLineWidth(5.0); + glBegin(GL_LINES); + for (i = 0; i < mesh->edgecount; i++){ + glColor3f(0, 0, 0); + glVertex3fv(mesh->edges[i].v1->position); + glVertex3fv(mesh->edges[i].v2->position); + } + + glEnd(); + glEnable(GL_LIGHTING); + glEnable(GL_DEPTH); + + + this->material.disable(); + //glEnable(GL_CULL_FACE); +} + + + + + + +MeshShape::MeshShape(MeshObject *object) : Shape(object){ + mesh = object->mesh; +} + +MeshShape::MeshShape(Object *object, Mesh *mesh) : Shape(object){ + this->mesh = mesh; +} + +bool MeshShape::checkCollision(Object *target){ + return target->geometry->checkCollisionPeer(this); +} + +float MeshShape::calculateMomentOfInertia(float *rotationvector){ + if (vectorDot(rotationvector, rotationvector) < EPSILON) return 0; + int i; + float j = 0; + for (i = 0; i < mesh->vertexcount; i++){ + float proj[3]; + vectorProject(proj, mesh->vertices[i].position, rotationvector); + vectorSub(proj, mesh->vertices[i].position, proj); + //float r = vectorLength(proj); + float r2 = vectorDot(proj, proj); + j += r2; + } + return j / i; +} + +bool MeshShape::checkCollisionPeer(SphereShape *target){ + float position[3] = {0, 0, 0}; + target->object->transformPoint(position, position); + object->unTransformPoint(position, position); + + float normal[3]; + float contactpoint[3]; + float r = target->getRadius(); + + if (checkSphereMeshCollision(position, r, mesh, normal, contactpoint)){ + vectorScale(normal, -1); + object->transformVector(normal, normal); + object->transformPoint(contactpoint, contactpoint); + + addCollision(object, target->object, normal, contactpoint); + + //vectorAdd(contactnormal, normal); + + return true; + } + + return false; +} + +//extern Sound *shotsound; + +bool MeshShape::checkCollisionPeer(MeshShape *target){ + float normal[3]; + float contactpoint[3]; + + bool collided = false; + + int i; + + Mesh *sourcemesh, *targetmesh; + + sourcemesh = this->mesh; + targetmesh = target->mesh; + for (i = 0; i < sourcemesh->vertexcount; i++){ + Vertex *vertex = &sourcemesh->vertices[i]; + float vertexposition[3]; + object->transformPoint(vertexposition, vertex->position); + target->object->unTransformPoint(vertexposition, vertexposition); + + if (checkPointMeshCollision(vertexposition, targetmesh, normal, contactpoint)){ + target->object->transformVector(normal, normal); + target->object->transformPoint(contactpoint, contactpoint); + + if (vectorIsZero(contactpoint)){ + vectorSet(contactpoint, 0, 0, 0); + } + addCollision(object, target->object, normal, contactpoint); + collided = true; + } + } + + sourcemesh = target->mesh; + targetmesh = this->mesh; + for (i = 0; i < sourcemesh->vertexcount; i++){ + Vertex *vertex = &sourcemesh->vertices[i]; + float vertexposition[3]; + target->object->transformPoint(vertexposition, vertex->position); + object->unTransformPoint(vertexposition, vertexposition); + + if (checkPointMeshCollision(vertexposition, targetmesh, normal, contactpoint)){ + object->transformVector(normal, normal); + object->transformPoint(contactpoint, contactpoint); + + addCollision(target->object, object, normal, contactpoint); + collided = true; + } + } + + sourcemesh = this->mesh; + targetmesh = target->mesh; + for (i = 0; i < sourcemesh->edgecount; i++){ + Edge *edge = &sourcemesh->edges[i]; + float v1[3], v2[3]; + object->transformPoint(v1, edge->v1->position); + target->object->unTransformPoint(v1, v1); + + object->transformPoint(v2, edge->v2->position); + target->object->unTransformPoint(v2, v2); + + if (checkEdgeMeshCollision(v1, v2, targetmesh, normal, contactpoint)){ + target->object->transformVector(normal, normal); + target->object->transformPoint(contactpoint, contactpoint); + + addCollision(object, target->object, normal, contactpoint); + collided = true; + } + } + + return collided; +} + diff --git a/src/mesh.h b/src/mesh.h new file mode 100644 index 0000000..285520b --- /dev/null +++ b/src/mesh.h @@ -0,0 +1,169 @@ +/* + * $Id: mesh.h,v 1.12 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: mesh.h,v $ + * Revision 1.12 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.11 2002/07/19 20:08:28 msell + * Linux-porttausta + * + * Revision 1.10 2002/07/17 20:32:47 msell + * Detail-optio toimii + * + * Revision 1.9 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.8 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.7 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.6 2002/07/07 17:53:21 msell + * Legoukon alku + * + * Revision 1.5 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.4 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.3 2002/06/26 22:30:29 jkaarlas + * lisätty Vertexiin tekstuurikoordinaatit + * + * Revision 1.2 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.1 2002/06/20 22:50:12 msell + * Meshit + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __MESH_H_INCLUDED__ +#define __MESH_H_INCLUDED__ + +#include "object.h" + + +#define X_AXIS 0 +#define Y_AXIS 1 +#define Z_AXIS 2 + + +class Vertex{ +public: + float position[3]; + float oldposition[3]; + float normal[3]; + float texcoords[2]; + + Vertex(void); + Vertex(float x, float y, float z); + Vertex(float x, float y, float z, float nx, float ny, float nz); + + void setTexCoords(float u, float v); +}; + + +class Edge; + +class Polygon{ +public: + float planenormal[3]; + float planedistance; + bool smooth; + bool realsmooth; + + int vertexcount; + Vertex **vertices; + int edgecount; + Edge **edges; + + Polygon(void); +}; + + + +class Edge{ +public: + Vertex *v1, *v2; + class Polygon *p1, *p2; +}; + + + +class Mesh{ +public: + int vertexcount; + Vertex *vertices; + + int polygoncount; + class Polygon *polygons; + + Edge *edges; + int edgecount; + + + Mesh(void); + ~Mesh(void); + + void createPlanes(void); + void createVertexnormals(void); + void createEdges(void); + float calculateScale(float targetLength, int axis); + void scale(float targetLength, int axis); + void scale(float scale); +}; + + + +class MeshObject : public Object{ +public: + Mesh *mesh; + + MeshObject(Mesh *mesh); +}; + + + +class MeshAppearance : public Appearance{ +private: + Mesh *mesh; + +public: + MeshAppearance(Mesh *mesh); + + void draw(void); +}; + + + +//Geometry of sphere + +class MeshShape : public Shape{ +private: + Mesh *mesh; + +public: + MeshShape(MeshObject *meshobject); + MeshShape(Object *object, Mesh *mesh); + + float calculateMomentOfInertia(float *rotationvector); + + bool checkCollision(Object *target); + + bool checkCollisionPeer(SphereShape *target); + bool checkCollisionPeer(MeshShape *target); + + friend class SphereShape; +}; + +#endif + diff --git a/src/object.cpp b/src/object.cpp new file mode 100644 index 0000000..4aac3cb --- /dev/null +++ b/src/object.cpp @@ -0,0 +1,292 @@ +/* + * $Id: object.cpp,v 1.22 2002/07/18 23:05:31 msell Exp $ + * + * + * $Log: object.cpp,v $ + * Revision 1.22 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.21 2002/07/17 22:45:54 msell + * Ääniä vähän + * + * Revision 1.20 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.19 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.18 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.17 2002/07/07 15:29:07 msell + * Törmäyksien parantelua + * + * Revision 1.16 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.15 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.14 2002/06/27 14:39:48 msell + * Toimiva maila :) + * Pyörivät kappaleet siis antaa liike-energiaa liikkuville kappaleille (ei toisin päin vielä) + * + * Revision 1.13 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.12 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.11 2002/06/17 20:49:05 msell + * free -> SDL_FreeSurface + * + * Revision 1.10 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.9 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.8 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.7 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * Revision 1.6 2002/06/07 21:16:51 msell + * Fysiikkaenginen alkua + * + * Revision 1.5 2002/06/05 18:39:05 msell + * Jotain pientä + * + * Revision 1.4 2002/06/05 15:00:41 msell + * Palikoihin lisää detailia, facet jaetaan halutun kokosiin osiin + * + * Revision 1.3 2002/06/03 23:20:43 msell + * no message + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.1 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * + * + * $Date: 2002/07/18 23:05:31 $ + * + */ + +#include "main.h" + +#include + +#include "object.h" +#include "vector.h" +#include "collision.h" +#include "utils.h" +#include "fight.h" +#include "glapi.h" + +Object::Object(void){ + appearance = NULL; + geometry = NULL; + invmass = 0.0; + setPosition(0, 0, 0); + vectorSet(momentum, 0, 0, 0); + + invmomentofinertia = 0.0; + matrixIdentity(rotation); + vectorSet(angularmomentum, 0, 0, 0); + + setCollisionGroup(COLLISIONGROUP_NONE); + gravity = false; +} + +void Object::prepare(void){ + if (appearance != NULL) appearance->prepare(); +} + +#define DT 0.01 + +void Object::move(void){ + moveStep(DT); +} + +void Object::moveStep(float dt){ + if (invmass == 0) return; + + + if (vectorDot(momentum, momentum) > 1.0e+5) vectorSet(momentum, 0, 0, 0); + if (vectorDot(angularmomentum, angularmomentum) > 1.0e+5) vectorSet(angularmomentum, 0, 0, 0); + calculateStateVariables(); + + + float velocitydt[3]; + vectorScale(velocitydt, velocity, dt); + vectorAdd(position, velocitydt); + + float rotationdt[9]; + if (vectorIsZero(angularmomentum)){ + matrixIdentity(rotationdt); + } else{ + float angularvelocitydt[3]; + vectorScale(angularvelocitydt, angularvelocity, dt); + matrixCreateRotation(rotationdt, angularvelocitydt); + } + matrixMultiply(rotation, rotation, rotationdt); + + vectorScale(angularmomentum, 0.99); +} + +void Object::calculateStateVariables(void){ + getVelocity(velocity); + + if (vectorIsZero(angularmomentum)){ + invmomentofinertia = 0; + } else{ + invmomentofinertia = invmass * 1.0 / geometry->calculateMomentOfInertia(angularmomentum); + } + + vectorScale(angularvelocity, angularmomentum, invmomentofinertia); +} + +void Object::setPosition(float x, float y, float z){ + position[0] = x; + position[1] = y; + position[2] = z; +} + +void Object::getPosition(float *position){ + vectorCopy(position, this->position); +} + +void Object::getVelocity(float *velocity){ + vectorCopy(velocity, momentum); + vectorScale(velocity, invmass); +} + +void Object::getVelocity(float *velocity, float *point){ + getVelocity(velocity); + + float tangentialvelocity[3]; + getTangentialVelocity(tangentialvelocity, point); + //float tv[3]; + //transformVector(tv, tangentialvelocity); + vectorAdd(velocity, tangentialvelocity); +} + +void Object::getTangentialVelocity(float *target, float *point){ + if (vectorIsZero(angularmomentum)){ + vectorSet(target, 0, 0, 0); + return; + } + + vectorCross(target, angularmomentum, point); + vectorScale(target, invmomentofinertia); +} + +void Object::getMomentum(float *momentum){ + vectorCopy(momentum, this->momentum); +} + +void Object::setMass(float mass){ + if (mass == 0) this->invmass = 0; + else this->invmass = 1.0 / mass; +} + +float Object::getMass(void){ + if (invmass == 0) return 0; + return 1.0 / invmass; +} + +void Object::setCollisionGroup(int group){ + this->collisiongroup = group; +} + +int Object::getCollisionGroup(void){ + return collisiongroup; +} + +void Object::addImpulse(float *impulse, float *contactpoint){ + if (invmass == 0) return; + float angularimpulse[3]; + vectorCross(angularimpulse, contactpoint, impulse); + vectorAdd(angularmomentum, angularimpulse); + + vectorAdd(momentum, impulse); + + float t1[3], t2[3]; + vectorAdd(t1, contactpoint, position); + vectorNormalize(t2, impulse); + vectorAdd(t2, t1); + + //addGraphicsVector(t1, t2, vectorLength(impulse)); +} + +void Object::addExternalForce(float *force){ + float impulse[3]; + vectorScale(impulse, force, DT); + + float contact[3] = {0, 0, 0}; + this->addImpulse(impulse, contact); +} + +void Object::transformPoint(float *newpoint, float *oldpoint){ + vectorMatrixMultiply(newpoint, oldpoint, rotation); + vectorAdd(newpoint, position); +} + +void Object::unTransformPoint(float *newpoint, float *oldpoint){ + vectorSub(newpoint, oldpoint, position); + float rotmat[9]; + matrixTranspose(rotmat, rotation); + vectorMatrixMultiply(newpoint, newpoint, rotmat); +} + +void Object::transformVector(float *newvector, float *oldvector){ + vectorMatrixMultiply(newvector, oldvector, rotation); +} + +void Object::unTransformVector(float *newvector, float *oldvector){ + float rotmat[9]; + matrixTranspose(rotmat, rotation); + vectorMatrixMultiply(newvector, oldvector, rotmat); +} + + +void Object::hitForce(float speed, float *speed2, Object *source){ + float tolerance = 1.0; + if (speed > tolerance){ + Sound *sound; + if (rand()&1) sound = softhitsound1; + else sound = softhitsound2; + float volume = (speed-tolerance)*2; + if (volume > 1) volume = 1; + sound->setVolume(volume); + sound->play(30 + random(70)); + } +} + + + + +void Object::setGravity(bool enabled){ + gravity = enabled; +} + +void Object::draw(void){ + glPushMatrix(); + glTranslatef(position[0], position[1], position[2]); + + GLfloat glmatrix[16] = { + rotation[0], rotation[1], rotation[2], 0, + rotation[3], rotation[4], rotation[5], 0, + rotation[6], rotation[7], rotation[8], 0, + 0 , 0 , 0 , 1}; + glMultMatrixf(glmatrix); + + if (appearance != NULL) appearance->draw(); + + glPopMatrix(); +} diff --git a/src/object.h b/src/object.h new file mode 100644 index 0000000..1ebf37c --- /dev/null +++ b/src/object.h @@ -0,0 +1,219 @@ +/* + * $Id: object.h,v 1.20 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: object.h,v $ + * Revision 1.20 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.19 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.18 2002/07/17 22:45:54 msell + * Ääniä vähän + * + * Revision 1.17 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.16 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.15 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.14 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.13 2002/06/27 14:39:48 msell + * Toimiva maila :) + * Pyörivät kappaleet siis antaa liike-energiaa liikkuville kappaleille (ei toisin päin vielä) + * + * Revision 1.12 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.11 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.10 2002/06/15 22:56:37 msell + * Säätöä + * + * Revision 1.9 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.8 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * Revision 1.7 2002/06/07 21:16:51 msell + * Fysiikkaenginen alkua + * + * Revision 1.6 2002/06/05 18:39:05 msell + * Jotain pientä + * + * Revision 1.5 2002/06/05 15:00:41 msell + * Palikoihin lisää detailia, facet jaetaan halutun kokosiin osiin + * + * Revision 1.4 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.3 2002/06/03 23:20:43 msell + * no message + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.1 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __OBJECT_H_INCLUDED__ +#define __OBJECT_H_INCLUDED__ + +class Object; + +#define EPSILON 1.0e-20 + +#include + +#include "shape.h" +#include "appearance.h" + +struct objectlist{ + Object *object; + objectlist *next; +}; + +class Object{ +public: + float invmass; + + /* Linear movement: + * position <-> paikka (x) + * velocity <-> nopeus (v) + * momentum <-> liikemäärä (p) + * force <-> voima (F) + * x' = v + * p' = F + * p = mv + * F = ma + * v' = a + */ + + float position[3]; + //derivative: velocity = momentum / mass + + float momentum[3];//, oldmomentum[3]; + //derivative: force + + //float force[3]; //Temporary properties + //float externalforce[3]; + + + /* Angular movement: + * rotation <-> orientaatio (R) + * angular velocity <-> kulmanopeus (w) + * angular momentum <-> pyörimisliikemäärä, vääntömomentti (L) + * torque <-> voiman momentti (M,T) + * moment of inertia <-> hitausmomentti (J,I) + * angular acceleration <-> kulmakiihtyvyys (a) + * L = J*w + * R' = Star(L) * R + * T = J*a + * w' = a + * L' = T + */ + + float invmomentofinertia; + + float rotation[9]; + //derivative: StarOperation(angularvelocity) * rotation + + float angularmomentum[3]; + //angular momentum = angular velocity * moment of inertia + //derivative: torque = angular acceleration * moment of inertia + + //float torque[3]; //Temporary property + + + void moveStep(float dt); + //void applyForces(float dt); + + void calculateStateVariables(void); + + int collisiongroup; + + void addImpulse(float *impulse, float *contactpoint); + + Appearance *appearance; + Shape *geometry; + + bool gravity; + + + + Object(void); + + virtual void prepare(void); + virtual void move(void); + virtual void draw(void); + + void setPosition(float x, float y, float z); + void getPosition(float *position); + + //Gets velocity from object and return it in "velocity" + void getVelocity(float *velocity); + + //Gets velocity from object for point "point" with + //tangential speed and return it in "velocity" + void getVelocity(float *velocity, float *point); + + void getTangentialVelocity(float *target, float *point); + + void getMomentum(float *momentum); + //void getForce(float *force); + void setMass(float mass); + float getMass(void); + void setCollisionGroup(int group); + int getCollisionGroup(void); + + void transformPoint(float *newpoint, float *oldpoint); + void unTransformPoint(float *newpoint, float *oldpoint); + void transformVector(float *newvector, float *oldvector); + void unTransformVector(float *newvector, float *oldvector); + + void addExternalForce(float *force); + + void setGravity(bool enabled); + + + + virtual void hitForce(float speed, float *speed2, Object *source); + + + + + + + + + friend class ObjectLink; + //friend void collide(Object *source, Object *target, float *normal, float *contactpoint); + friend bool checkCollisions(Object *object, float *contactnormal); + + + + + + + //Temporary state variables + float velocity[3]; + float angularvelocity[3]; +}; + +#endif + diff --git a/src/objectfactory.cpp b/src/objectfactory.cpp new file mode 100644 index 0000000..657626d --- /dev/null +++ b/src/objectfactory.cpp @@ -0,0 +1,371 @@ +/* + * $Id: objectfactory.cpp,v 1.12 2002/07/22 01:14:14 msell Exp $ + * + * + * $Log: objectfactory.cpp,v $ + * Revision 1.12 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.11 2002/07/15 20:32:35 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.10 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.9 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.8 2002/07/11 18:33:07 jkaarlas + * ascloaderi palauttaa nyt meshin + * + * Revision 1.7 2002/07/10 22:22:53 msell + * Cartoon-rendaus + * + * Revision 1.6 2002/07/10 22:07:23 jkaarlas + * skaalatut ja käännellyt ruumiinosat + * + * Revision 1.5 2002/07/09 19:54:35 msell + * intit floateiks asc-loaderista + * + * Revision 1.4 2002/06/26 22:30:02 jkaarlas + * lisätty asc-loaderi + * + * Revision 1.3 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.2 2002/06/23 20:12:19 msell + * Parempi törmäystarkistus palloista mesheihin + * + * Revision 1.1 2002/06/20 22:50:12 msell + * Meshit + * + * + * + * $Date: 2002/07/22 01:14:14 $ + * + */ + +#include "main.h" + +#include +#include +#include + +#include "object.h" +#include "mesh.h" +#include "vector.h" +#include "utils.h" +#include "3dutils.h" +#include "objectfactory.h" +#include "glapi.h" + + +MeshObject *createPyramid(float width, float height){ + Mesh *mesh = new Mesh(); + mesh->vertexcount = 5; + mesh->vertices = new Vertex[5]; + vectorSet(mesh->vertices[0].position, width, 0, 0); + vectorSet(mesh->vertices[0].normal, 1, 0, 0); + vectorSet(mesh->vertices[1].position, -width, 0, 0); + vectorSet(mesh->vertices[1].normal, -1, 0, 0); + vectorSet(mesh->vertices[2].position, 0, 0, width); + vectorSet(mesh->vertices[2].normal, 0, 0, 1); + vectorSet(mesh->vertices[3].position, 0, 0, -width); + vectorSet(mesh->vertices[3].normal, 0, 0, -1); + vectorSet(mesh->vertices[4].position, 0, height, 0); + vectorSet(mesh->vertices[4].normal, 0, 1, 0); + + mesh->polygoncount = 5; + mesh->polygons = new class Polygon[5]; + + mesh->polygons[0].vertexcount = 3; + mesh->polygons[0].vertices = new Vertex *[3]; + mesh->polygons[0].vertices[0] = &mesh->vertices[4]; + mesh->polygons[0].vertices[1] = &mesh->vertices[0]; + mesh->polygons[0].vertices[2] = &mesh->vertices[3]; + + mesh->polygons[1].vertexcount = 3; + mesh->polygons[1].vertices = new Vertex *[3]; + mesh->polygons[1].vertices[0] = &mesh->vertices[4]; + mesh->polygons[1].vertices[1] = &mesh->vertices[3]; + mesh->polygons[1].vertices[2] = &mesh->vertices[1]; + + mesh->polygons[2].vertexcount = 3; + mesh->polygons[2].vertices = new Vertex *[3]; + mesh->polygons[2].vertices[0] = &mesh->vertices[4]; + mesh->polygons[2].vertices[1] = &mesh->vertices[1]; + mesh->polygons[2].vertices[2] = &mesh->vertices[2]; + + mesh->polygons[3].vertexcount = 3; + mesh->polygons[3].vertices = new Vertex *[3]; + mesh->polygons[3].vertices[0] = &mesh->vertices[4]; + mesh->polygons[3].vertices[1] = &mesh->vertices[2]; + mesh->polygons[3].vertices[2] = &mesh->vertices[0]; + + mesh->polygons[4].vertexcount = 4; + mesh->polygons[4].vertices = new Vertex *[4]; + mesh->polygons[4].vertices[0] = &mesh->vertices[0]; + mesh->polygons[4].vertices[1] = &mesh->vertices[2]; + mesh->polygons[4].vertices[2] = &mesh->vertices[1]; + mesh->polygons[4].vertices[3] = &mesh->vertices[3]; + + mesh->polygons[0].smooth = false; + mesh->polygons[1].smooth = false; + mesh->polygons[2].smooth = false; + mesh->polygons[3].smooth = false; + mesh->polygons[4].smooth = false; + + mesh->createPlanes(); + + MeshObject *object = new MeshObject(mesh); + return object; +} + +MeshObject *createSpherePool(float width, float height){ + int grid = 16; + + Mesh *mesh = new Mesh(); + mesh->vertexcount = (grid+1)*(grid+1); + mesh->vertices = new Vertex[mesh->vertexcount]; + + int x, z; + for (z = 0; z < grid; z++){ + float pz = (2.0*z/(grid-1) - 1)*width; + for (x = 0; x < grid; x++){ + float px = (2.0*x/(grid-1) - 1)*width; + + //float py = randomf(1); + float l = sqrt(pz*pz + px*px)*1; + if (l > width) l = width; + l = l/width; + //l = l*l; + float py = height*(sin(PI*(1.5+l*2))+1)/2; + vectorSet(mesh->vertices[z * grid + x].position, px, py, pz); + } + } + + mesh->polygoncount = (grid-1)*(grid-1); + mesh->polygons = new class Polygon[mesh->polygoncount]; + for (z = 0; z < grid-1; z++){ + for (x = 0; x < grid-1; x++){ + class Polygon *poly = &mesh->polygons[z * (grid-1) + x]; + poly->vertexcount = 4; + poly->vertices = new Vertex *[4]; + + poly->vertices[0] = &mesh->vertices[z * grid + x + 1]; + poly->vertices[1] = &mesh->vertices[z * grid + x ]; + poly->vertices[2] = &mesh->vertices[(z + 1) * grid + x]; + poly->vertices[3] = &mesh->vertices[(z + 1) * grid + x + 1]; + + poly->smooth = true; + } + } + + + mesh->createPlanes(); + mesh->createVertexnormals(); + + MeshObject *object = new MeshObject(mesh); + return object; +} + +Mesh *createBox(float x1, float x2, float y1, float y2, float z1, float z2){ + Mesh *mesh = new Mesh(); + mesh->vertexcount = 8; + mesh->vertices = new Vertex[8]; + vectorSet(mesh->vertices[0].position, x1, y1, z1); + vectorSet(mesh->vertices[1].position, x2, y1, z1); + vectorSet(mesh->vertices[2].position, x1, y2, z1); + vectorSet(mesh->vertices[3].position, x2, y2, z1); + vectorSet(mesh->vertices[4].position, x1, y1, z2); + vectorSet(mesh->vertices[5].position, x2, y1, z2); + vectorSet(mesh->vertices[6].position, x1, y2, z2); + vectorSet(mesh->vertices[7].position, x2, y2, z2); + + mesh->polygoncount = 6; + mesh->polygons = new class Polygon[6]; + + //Back + mesh->polygons[0].vertexcount = 4; + mesh->polygons[0].vertices = new Vertex *[4]; + mesh->polygons[0].vertices[0] = &mesh->vertices[0]; + mesh->polygons[0].vertices[1] = &mesh->vertices[2]; + mesh->polygons[0].vertices[2] = &mesh->vertices[3]; + mesh->polygons[0].vertices[3] = &mesh->vertices[1]; + + //Front + mesh->polygons[1].vertexcount = 4; + mesh->polygons[1].vertices = new Vertex *[4]; + mesh->polygons[1].vertices[0] = &mesh->vertices[4]; + mesh->polygons[1].vertices[1] = &mesh->vertices[5]; + mesh->polygons[1].vertices[2] = &mesh->vertices[7]; + mesh->polygons[1].vertices[3] = &mesh->vertices[6]; + + //Left + mesh->polygons[2].vertexcount = 4; + mesh->polygons[2].vertices = new Vertex *[4]; + mesh->polygons[2].vertices[0] = &mesh->vertices[0]; + mesh->polygons[2].vertices[1] = &mesh->vertices[4]; + mesh->polygons[2].vertices[2] = &mesh->vertices[6]; + mesh->polygons[2].vertices[3] = &mesh->vertices[2]; + + //Right + mesh->polygons[3].vertexcount = 4; + mesh->polygons[3].vertices = new Vertex *[4]; + mesh->polygons[3].vertices[0] = &mesh->vertices[1]; + mesh->polygons[3].vertices[1] = &mesh->vertices[3]; + mesh->polygons[3].vertices[2] = &mesh->vertices[7]; + mesh->polygons[3].vertices[3] = &mesh->vertices[5]; + + //Top + mesh->polygons[4].vertexcount = 4; + mesh->polygons[4].vertices = new Vertex *[4]; + mesh->polygons[4].vertices[0] = &mesh->vertices[2]; + mesh->polygons[4].vertices[1] = &mesh->vertices[6]; + mesh->polygons[4].vertices[2] = &mesh->vertices[7]; + mesh->polygons[4].vertices[3] = &mesh->vertices[3]; + + //Bottom + mesh->polygons[5].vertexcount = 4; + mesh->polygons[5].vertices = new Vertex *[4]; + mesh->polygons[5].vertices[0] = &mesh->vertices[0]; + mesh->polygons[5].vertices[1] = &mesh->vertices[1]; + mesh->polygons[5].vertices[2] = &mesh->vertices[5]; + mesh->polygons[5].vertices[3] = &mesh->vertices[4]; + + mesh->createPlanes(); + mesh->createEdges(); + //mesh->createVertexnormals(); + + return mesh; +} + + +float getValueFromString(char* data){ + while(*data==' ') data++; + char* enddata=data; + //char oldchar; + do{ + enddata++; + if ((*enddata<'0' || *enddata>'9') && (*enddata!='.')) *enddata=0; + } while(*enddata!=0); + float ret=atof(data); + *enddata=' '; + return ret; +} + +char* findStringEnd(char* data, char* findstring){ + return strstr(data,findstring)+strlen(findstring); +} + +Mesh* loadAscModel(char *filename, float scale){ + float zeroOffset[3] = {0.0, 0.0, 0.0}; + return loadAscModel(filename, scale, (float*)zeroOffset); +} + +Mesh* loadAscModel(char *filename, float scale, float* offset){ + + Mesh* target = new Mesh(); + + + FILE* file; + float x, y, z; + + if ((file=fopen(filename,"rt"))==NULL){ + printf("Unable to open file %s\n",filename); + return NULL; + } + fseek(file,0,SEEK_END); + int size=ftell(file); + fseek(file,0,SEEK_SET); + char* data=(char*)malloc(size*sizeof(char)); + fread(data,size,1,file); + fclose(file); + char* vert=findStringEnd(data,"Vertices:"); + target->vertexcount=getValueFromString(vert); + char* face=findStringEnd(data,"Faces:"); + target->polygoncount=getValueFromString(face); + target->vertices = new Vertex[target->vertexcount]; + target->polygons = new class Polygon[target->polygoncount]; + + + int i; + + vert=findStringEnd(data,"Vertex list:"); + + for (i=0;ivertexcount;i++){ + vert=findStringEnd(vert,"Vertex"); + vert=findStringEnd(vert,"X:"); + x = getValueFromString(vert)*scale; + vert=findStringEnd(vert,"Y:"); + y = getValueFromString(vert)*scale; + vert=findStringEnd(vert,"Z:"); + z = getValueFromString(vert)*scale; + vectorSet(target->vertices[i].position, x + offset[0], y + offset[1] , z + offset[2]); + //recycle variables for texture coordinates + vert = findStringEnd(vert, "U:"); + x = getValueFromString(vert); + vert = findStringEnd(vert, "V:"); + y = getValueFromString(vert); + target->vertices[i].setTexCoords(x, y); + } + int vnum; + face=findStringEnd(data,"Face list:"); + + + for (i=0;ipolygoncount;i++){ + face=findStringEnd(face,"Face"); + face=findStringEnd(face,"A:"); + vnum=getValueFromString(face); + target->polygons[i].vertexcount = 3; + target->polygons[i].vertices = new Vertex *[3]; + target->polygons[i].vertices[0]=&(target->vertices[vnum]); + target->polygons[i].vertices[0]->setTexCoords(target->vertices[vnum].texcoords[0], + target->vertices[vnum].texcoords[1]); + face=findStringEnd(face,"B:"); + vnum=getValueFromString(face); + target->polygons[i].vertices[1]=&(target->vertices[vnum]); + target->polygons[i].vertices[1]->setTexCoords(target->vertices[vnum].texcoords[0], + target->vertices[vnum].texcoords[1]); + face=findStringEnd(face,"C:"); + vnum=getValueFromString(face); + target->polygons[i].vertices[2]=&(target->vertices[vnum]); + target->polygons[i].vertices[2]->setTexCoords(target->vertices[vnum].texcoords[0], + target->vertices[vnum].texcoords[1]); + char *face2=findStringEnd(face,"Nosmooth"); + char *face3=findStringEnd(face,"Smoothing"); + if (face2 > face && face2 < face3) target->polygons[i].realsmooth = true; + } + free(data); + data = NULL; + //target->createEdges(); + target->createPlanes(); + target->createVertexnormals(); + //return new MeshObject(target); + return target; +} + +void drawTrophy(void){ + point2d points[14]; + + int width = 3; + + int i = 0; + + points[i].x = 0.0; points[i].y = 0.0; i++; + points[i].x = width; points[i].y = 0.0; i++; + points[i].x = width-2; points[i].y = 2.0; i++; + points[i].x = width-2; points[i].y = 3.0; i++; + points[i].x = width-1; points[i].y = 4.0; i++; + points[i].x = width-2; points[i].y = 5.0; i++; + points[i].x = width-2; points[i].y = 6.0; i++; + points[i].x = width-1; points[i].y = 8.0; i++; + points[i].x = width; points[i].y = 9.0; i++; + points[i].x = width+1; points[i].y = 11.0; i++; + points[i].x = width+2; points[i].y = 15.0; i++; + points[i].x = width+3; points[i].y = 21.0; i++; + points[i].x = width+2; points[i].y = 21.0; i++; + points[i].x = 0.0; points[i].y = 8.0; i++; + + createLathedSurface(points, NULL, i, i*5, i*10); +} \ No newline at end of file diff --git a/src/objectfactory.h b/src/objectfactory.h new file mode 100644 index 0000000..99a7194 --- /dev/null +++ b/src/objectfactory.h @@ -0,0 +1,48 @@ +/* + * $Id: objectfactory.h,v 1.7 2002/07/22 01:14:14 msell Exp $ + * + * + * $Log: objectfactory.h,v $ + * Revision 1.7 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.6 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.5 2002/07/14 21:22:39 jkaarlas + * skybox ja ukkojen säätö + * + * Revision 1.4 2002/07/11 18:33:06 jkaarlas + * ascloaderi palauttaa nyt meshin + * + * Revision 1.3 2002/06/26 22:30:02 jkaarlas + * lisätty asc-loaderi + * + * Revision 1.2 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.1 2002/06/20 22:50:12 msell + * Meshit + * + * + * + * $Date: 2002/07/22 01:14:14 $ + * + */ + +#ifndef __OBJECTFACTORY_H_INCLUDED__ +#define __OBJECTFACTORY_H_INCLUDED__ + +#include "mesh.h" + +MeshObject* createPyramid(float width, float height); +MeshObject* createSpherePool(float width, float height); + + +Mesh* createBox(float x1, float x2, float y1, float y2, float z1, float z2); +Mesh* loadAscModel(char* filename, float scale, float* offset); +Mesh* loadAscModel(char* filename, float scale); +void drawTrophy(void); + +#endif + diff --git a/src/particle.cpp b/src/particle.cpp new file mode 100644 index 0000000..52b06cc --- /dev/null +++ b/src/particle.cpp @@ -0,0 +1,165 @@ +/* + * $Id: particle.cpp,v 1.1 2002/07/19 12:10:53 msell Exp $ + * + * + * $Log: particle.cpp,v $ + * Revision 1.1 2002/07/19 12:10:53 msell + * Hups + * + * + * + * $Date: 2002/07/19 12:10:53 $ + * + */ + +#include "main.h" + +#include + +#include "particle.h" +#include "vector.h" +#include "utils.h" +#include "world.h" +#include "objectfactory.h" +#include "collision.h" +#include "glapi.h" + + +Particle::Particle(World *world, Mesh *mesh) : MeshObject(mesh){ + this->world = world; +} + +Contact *contact = new Contact(); + +int bloodcount; + +void Particle::move(void){ + /*if (position[1] + momentum[1] < 0.5){ + currentparticle->velocity.x*=0.8; + currentparticle->velocity.y=fabs(currentparticle->velocity.y)*0.8; + currentparticle->velocity.z*=0.8; + currentparticle->bounces++; + } + currentparticle->position.x+=currentparticle->velocity.x; + currentparticle->position.y+=currentparticle->velocity.y; + currentparticle->position.z+=currentparticle->velocity.z; + currentparticle->angle.x+=currentparticle->velocity.x*50; + currentparticle->angle.y+=currentparticle->velocity.y*50; + currentparticle->angle.z+=currentparticle->velocity.z*50; + currentparticle->velocity.y-=0.003; + if (currentparticle->bounces==3) dieParticle(currentparticle);*/ + momentum[1] -= 0.02; + int i; + vectorSet(contact->normal, 0, 1, 0); + contact->object2 = NULL; + bool die = false; + for (i = 0; i < mesh->vertexcount; i++){ + float point[3]; + transformPoint(point, mesh->vertices[i].position); + if (point[1] < 0){ + contact->object1 = this; + vectorCopy(contact->position, point); + handleCollision(contact); + /*float impulse[3]; + getMomentum(impulse); + impulse[0] = 0; + impulse[1] = fabs(impulse[1]); + impulse[2] = 0; + vectorScale(impulse, 1.1); + addImpulse(impulse, point); + position[1] -= point[1]; + momentum[1] = impulse[1]*0.5;*/ + } + } + /*if (vectorLength(momentum) < 0.5) die = true; + if (die) removeBlood(id);*/ + lifetime++; + Object::move(); + + if (lifetime > 300) removeBlood(id); +} + +void Particle::hitForce(float speed, Object *source){ + /*bounces++; + if (bounces == 2){ + removeBlood(id); + }*/ +} + +void Particle::create(float *position, float *velocity){ + vectorCopy(this->position, position); + vectorCopy(this->momentum, velocity); + float rotate[3] = {randomf(2)-1, randomf(2)-1, randomf(2)-1}; + vectorCopy(this->angularmomentum, rotate); + bounces = 0; + lifetime = 0; + world->addParticle(this); +} + +void Particle::destroy(void){ + world->removeParticle(this); +} + + +Particle **bloodparticles; + +BloodAppearance::BloodAppearance(int *lifetime) : BasicBlockAppearance(1, 1, 1){ + this->lifetime = lifetime; + usematerial = false; +} + +void BloodAppearance::draw(void){ + glPushMatrix(); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + + float alpha = 1-*lifetime*0.003; + if (alpha < 0) alpha = 0; + + glColor4f(1, 0, 0, alpha);//1.0/(1+*lifetime*0.004)); + + glScalef(0.5, 0.5, 0.5); + BasicBlockAppearance::draw(); + + glDisable(GL_BLEND); + + glPopMatrix(); +} + +World *bloodworld; + +void initBloods(World *world){ + bloodcount = 0; + bloodparticles = new Particle *[MAXBLOOD]; + int i; + Mesh *bloodmesh = createBox(-0.5, 0.5, -0.5*BLOCKHEIGHT, 0.5*BLOCKHEIGHT, -0.5, 0.5); + for (i = 0; i < MAXBLOOD; i++){ + bloodparticles[i] = new Particle(world, bloodmesh); + bloodparticles[i]->appearance = new BloodAppearance(&(bloodparticles[i]->lifetime)); + bloodparticles[i]->setMass(1); + bloodparticles[i]->prepare(); + //bloodparticles[i]->setGravity(true); + //bloodparticles[i]->setCollisionGroup(COLLISIONGROUP_PARTICLE); + //bloodparticles[i]->id = i; + } + bloodworld = world; +} + +void createBlood(float *position, float *velocity){ + if (bloodcount < MAXBLOOD){ + Particle *currentparticle = bloodparticles[bloodcount]; + currentparticle->create(position, velocity); + currentparticle->id = bloodcount; + bloodcount++; + } +} + +void removeBlood(int id){ + Particle *particle = bloodparticles[id]; + particle->destroy(); + bloodparticles[id] = bloodparticles[bloodcount-1]; + bloodparticles[id]->id = id; + bloodparticles[bloodcount-1] = particle; + bloodcount--; +} \ No newline at end of file diff --git a/src/particle.h b/src/particle.h new file mode 100644 index 0000000..2dc22d6 --- /dev/null +++ b/src/particle.h @@ -0,0 +1,73 @@ +/* + * $Id: particle.h,v 1.2 2002/07/19 20:33:28 msell Exp $ + * + * + * $Log: particle.h,v $ + * Revision 1.2 2002/07/19 20:33:28 msell + * #pragma once -> #ifndef + * + * Revision 1.1 2002/07/19 12:10:53 msell + * Hups + * + * + * + * $Date: 2002/07/19 20:33:28 $ + * + */ + +#ifndef __PARTICLE_H_INCLUDED__ +#define __PARTICLE_H_INCLUDED__ + +class Particle; +class BloodAppearance; + +#include "object.h" +#include "legoblocks.h" +#include "world.h" + +class Particle : public MeshObject{ +private: + int bounces; + bool enabled; + + World *world; + + bool alive; + +public: + int lifetime; + int id; + + Particle(World *world, Mesh *mesh); + + void move(void); + + void hitForce(float speed, Object *source); + + + void create(float *position, float *velocity); + void destroy(void); +}; + + + + +#define MAXBLOOD 500 + + +class BloodAppearance : public BasicBlockAppearance{ +private: + int *lifetime; + +public: + BloodAppearance(int *lifetime); + + void draw(void); +}; + +void initBloods(World *world); +void createBlood(float *position, float *velocity); +void removeBlood(int id); + +#endif + diff --git a/src/run.cpp b/src/run.cpp new file mode 100644 index 0000000..5f49420 --- /dev/null +++ b/src/run.cpp @@ -0,0 +1,298 @@ +/* + * $Id: run.cpp,v 1.24 2002/07/22 11:44:16 jkaarlas Exp $ + * + * + * $Log: run.cpp,v $ + * Revision 1.24 2002/07/22 11:44:16 jkaarlas + * naama + * + * Revision 1.23 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.22 2002/07/19 22:38:38 msell + * Pingviini + * + * Revision 1.21 2002/07/19 21:17:07 msell + * bugifixi + * + * Revision 1.20 2002/07/19 20:06:32 msell + * Linux-porttausta + * + * Revision 1.19 2002/07/19 19:46:07 msell + * Makefile + * + * Revision 1.18 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.17 2002/07/19 14:05:52 msell + * Damagetextuurit näkyy + * + * Revision 1.16 2002/07/19 12:48:57 jkaarlas + * damagepää + * + * Revision 1.15 2002/07/19 12:42:44 msell + * Loading... + * + * Revision 1.14 2002/07/17 20:32:48 msell + * Detail-optio toimii + * + * Revision 1.13 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.12 2002/07/16 19:57:14 jkaarlas + * lisätty DATAPATH tiedostonimien eteen + * + * Revision 1.11 2002/07/16 17:16:35 msell + * Fontit ja valikot + * + * Revision 1.10 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.9 2002/06/17 20:49:05 msell + * free -> SDL_FreeSurface + * + * Revision 1.8 2002/06/17 19:58:08 msell + * #includeiden parantelua + * + * Revision 1.7 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.6 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * Revision 1.5 2002/05/18 12:29:35 msell + * Valot ja äänijärjestelmän parantelua + * + * Revision 1.4 2002/05/17 12:30:26 msell + * no message + * + * Revision 1.3 2002/05/16 18:41:16 msell + * Vektorifunctioita ja kamera + * + * Revision 1.2 2002/05/15 21:07:23 msell + * Äänisäätöä + * + * Revision 1.1 2002/05/15 14:36:39 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/22 11:44:16 $ + * + */ + +#include "main.h" + +#include + +#include "run.h" +#include "fight.h" +#include "menu.h" +#include "end.h" +#include "graphics.h" +#include "3dutils.h" +#include "audio.h" +#include "font.h" +#include "legoblocks.h" +#include "glapi.h" + +int gamemode; + +bool changed; + +bool gameinitialized = false; + +void initFontTexture(void); + +void initScenes(void){ + knobgllist = glGenLists(1); + setDetail(detail); + + + //Simple loading-screen + enable2D(); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + SDL_GL_SwapBuffers(); + + initFontTexture(); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + print(0.08, 0.4, "Loading...", 0.2); + SDL_GL_SwapBuffers(); + + disable2D(); + + + + SKYBOX = -1; + initTextures(); + initFight(); + initMenu(); + initEnd(); + changeGameMode(MENUMODE); + //changeGameMode(ENDMODE); + gameinitialized = true; +} + +void changeGameMode(int newmode){ + gamemode = newmode; + changed = true; +} + +void calculateFrame(int framecount){ + switch(gamemode){ + case MENUMODE: + calculateMenu(framecount); + break; + case FIGHTMODE: + calculateFight(framecount); + break; + case ENDMODE: + calculateEnd(framecount); + break; + } + updateAudio(); + changed = false; +} + +void drawFrame(int framecount){ + if (changed) calculateFrame(framecount); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + + switch(gamemode){ + case MENUMODE: + drawMenu(framecount); + break; + case FIGHTMODE: + drawFight(framecount); + break; + case ENDMODE: + drawEnd(framecount); + break; + } + + SDL_GL_SwapBuffers(); +} + +/*int SKY_FRONT_ID; +int SKY_BACK_ID; +int SKY_LEFT_ID; +int SKY_RIGHT_ID; +int SKY_TOP_ID; +int SKY_BOTTOM_ID;*/ + +bool texturesloaded = false; + +Texture *flaretexture; +Texture *skyfronttexture; +Texture *skybacktexture; +Texture *skylefttexture; +Texture *skyrighttexture; +Texture *skytoptexture; +Texture *skybottomtexture; +Texture *damageHead; +Texture *damageTorso; +Texture *damageHand; +Texture *damageLeg; +Texture *tuxtexture; +Texture *faceTexture; + +void initFontTexture(void){ + if (!texturesloaded){ + float trans[3] = {1, 0, 0}; + fonttexture = new Texture(); + fonttexture->loadImage(DATAPATH"font.png", trans); + } else{ + fonttexture->reload(); + } +} + +void initTextures(void){ + /*SKY_FRONT_ID = DRUID.loadTexture(SKYFRONT); + SKY_BACK_ID = DRUID.loadTexture(SKYBACK); + SKY_LEFT_ID = DRUID.loadTexture(SKYLEFT); + SKY_RIGHT_ID = DRUID.loadTexture(SKYRIGHT); + SKY_TOP_ID = DRUID.loadTexture(SKYTOP); + SKY_BOTTOM_ID = DRUID.loadTexture(SKYBOTTOM);*/ + + if (!texturesloaded){ + skyfronttexture = new Texture(); + skyfronttexture->loadImage(SKYFRONT); + skybacktexture = new Texture(); + skybacktexture->loadImage(SKYBACK); + skylefttexture = new Texture(); + skylefttexture->loadImage(SKYLEFT); + skyrighttexture = new Texture(); + skyrighttexture->loadImage(SKYRIGHT); + skytoptexture = new Texture(); + skytoptexture->loadImage(SKYTOP); + skybottomtexture = new Texture(); + skybottomtexture->loadImage(SKYBOTTOM); + + + float something[3] = {1, 0, 0.5}; + damageHead = new Texture(); + damageHead->loadImage(DAMAGEHEAD, something); + damageTorso = new Texture(); + damageTorso->loadImage(DAMAGETORSO, something); + damageHand = new Texture(); + damageHand->loadImage(DAMAGEHAND, something); + damageLeg = new Texture(); + damageLeg->loadImage(DAMAGELEG, something); + faceTexture = new Texture(); + something[2] = 1; + faceTexture->loadImage(FACE, something); + + float zeros[3] = {0, 0, 0}; + flaretexture = new Texture(); + flaretexture->loadImage(DATAPATH"flare.png", zeros); + + + float pink[3] = {1, 0, 1}; + tuxtexture = new Texture(); + tuxtexture->loadImage(DATAPATH"tux.png", pink); + } else{ + skyfronttexture->reload(); + skybacktexture->reload(); + skylefttexture->reload(); + skyrighttexture->reload(); + skytoptexture->reload(); + skybottomtexture->reload(); + + damageHead->reload(); + damageTorso->reload(); + damageHand->reload(); + damageLeg->reload(); + + flaretexture->reload(); + + tuxtexture->reload(); + } + texturesloaded = true; +} + +void setDetail(int detail){ + switch(detail){ + case 0: + knobdetail = 0; + break; + case 1: + knobdetail = 5; + break; + case 2: + knobdetail = 8; + break; + case 3: + knobdetail = 16; + break; + } + initKnob(); +} + + diff --git a/src/run.h b/src/run.h new file mode 100644 index 0000000..04bcac4 --- /dev/null +++ b/src/run.h @@ -0,0 +1,55 @@ +/* + * $Id: run.h,v 1.9 2002/07/22 01:14:14 msell Exp $ + * + * + * $Log: run.h,v $ + * Revision 1.9 2002/07/22 01:14:14 msell + * Lopetussysteemi + * + * Revision 1.8 2002/07/19 20:33:29 msell + * #pragma once -> #ifndef + * + * Revision 1.7 2002/07/17 20:32:48 msell + * Detail-optio toimii + * + * Revision 1.6 2002/07/16 17:16:35 msell + * Fontit ja valikot + * + * Revision 1.5 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.4 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * Revision 1.3 2002/05/17 12:30:26 msell + * no message + * + * Revision 1.2 2002/05/16 18:41:16 msell + * Vektorifunctioita ja kamera + * + * Revision 1.1 2002/05/15 14:36:39 msell + * Yksinkertainen SDL-runko (Kääntyy toistaiseksi vain windowsissa). + * Mukana myös musiikinsoitto fmodilla. + * + * + * + * $Date: 2002/07/22 01:14:14 $ + * + */ + +#ifndef __RUN_H_INCLUDED__ +#define __RUN_H_INCLUDED__ + +#define MENUMODE 1 +#define FIGHTMODE 2 +#define ENDMODE 3 + +void initScenes(void); +void changeGameMode(int newmode); +void calculateFrame(int framecount); +void drawFrame(int framecount); +void initTextures(void); +void setDetail(int detail); + +#endif + diff --git a/src/shape.cpp b/src/shape.cpp new file mode 100644 index 0000000..ca081b6 --- /dev/null +++ b/src/shape.cpp @@ -0,0 +1,52 @@ +/* + * $Id: shape.cpp,v 1.7 2002/07/04 21:05:41 msell Exp $ + * + * + * $Log: shape.cpp,v $ + * Revision 1.7 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.6 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.5 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.4 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.3 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.2 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.1 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * + * + * + * $Date: 2002/07/04 21:05:41 $ + * + */ + +#include "shape.h" + +Shape::Shape(Object *object){ + this->object = object; +} + +bool Shape::checkCollision(Object *target){ + return false; +} +bool Shape::checkCollisionPeer(Shape *target){ + return false; +} +bool Shape::checkCollisionPeer(SphereShape *target){ + return false; +} +bool Shape::checkCollisionPeer(MeshShape *target){ + return false; +} diff --git a/src/shape.h b/src/shape.h new file mode 100644 index 0000000..fd047e6 --- /dev/null +++ b/src/shape.h @@ -0,0 +1,79 @@ +/* + * $Id: shape.h,v 1.12 2002/07/19 20:33:29 msell Exp $ + * + * + * $Log: shape.h,v $ + * Revision 1.12 2002/07/19 20:33:29 msell + * #pragma once -> #ifndef + * + * Revision 1.11 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.10 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.9 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.8 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.7 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.6 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.5 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * Revision 1.4 2002/06/07 21:16:51 msell + * Fysiikkaenginen alkua + * + * Revision 1.3 2002/06/05 23:55:46 msell + * Pallo + * + * Revision 1.2 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.1 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * + * + * $Date: 2002/07/19 20:33:29 $ + * + */ + +#ifndef __SHAPE_H_INCLUDED__ +#define __SHAPE_H_INCLUDED__ + +class Shape; +class SphereShape; +class MeshShape; + +#include "object.h" + +/* + * Abstract class for object geometry + */ +class Shape{ +protected: + Object *object; + +public: + Shape(Object *object); + + + virtual float calculateMomentOfInertia(float *rotationvector) = 0; + + virtual bool checkCollision(Object *target); + + virtual bool checkCollisionPeer(Shape *target); + virtual bool checkCollisionPeer(SphereShape *target); + virtual bool checkCollisionPeer(MeshShape *target); +}; + +#endif + diff --git a/src/sphere.cpp b/src/sphere.cpp new file mode 100644 index 0000000..f853862 --- /dev/null +++ b/src/sphere.cpp @@ -0,0 +1,333 @@ +/* + * $Id: sphere.cpp,v 1.19 2002/07/19 18:59:46 msell Exp $ + * + * + * $Log: sphere.cpp,v $ + * Revision 1.19 2002/07/19 18:59:46 msell + * Alkuhommaa ja säätöä + * + * Revision 1.18 2002/07/07 17:53:21 msell + * Legoukon alku + * + * Revision 1.17 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.16 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.15 2002/06/27 14:39:48 msell + * Toimiva maila :) + * Pyörivät kappaleet siis antaa liike-energiaa liikkuville kappaleille (ei toisin päin vielä) + * + * Revision 1.14 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.13 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.12 2002/06/23 20:12:19 msell + * Parempi törmäystarkistus palloista mesheihin + * + * Revision 1.11 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.10 2002/06/20 00:21:19 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.9 2002/06/17 20:49:05 msell + * free -> SDL_FreeSurface + * + * Revision 1.8 2002/06/16 01:04:58 jkaarlas + * tulipa säädettyä includejen kanssa. oon tod.näk. eri mieltä aamulla + * + * Revision 1.7 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.6 2002/06/14 00:26:17 msell + * 100 kimpoilevaa palloa ja vähän vaimennusta + * + * Revision 1.5 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.4 2002/06/11 23:23:03 msell + * Törmäystarkistusta + * + * Revision 1.3 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * Revision 1.2 2002/06/07 21:16:51 msell + * Fysiikkaenginen alkua + * + * Revision 1.1 2002/06/05 23:55:46 msell + * Pallo + * + * + * + * $Date: 2002/07/19 18:59:46 $ + * + */ + +#include "main.h" + +#include + +#include "sphere.h" +#include "utils.h" +#include "3dutils.h" +#include "audio.h" +#include "vector.h" +#include "collision.h" +#include "glapi.h" + + +Sphere::Sphere(void){ + appearance = new SphereAppearance(); + Object::appearance = appearance; + geometry = new SphereShape(this); + Object::geometry = geometry; +} + +void Sphere::setRadius(float r){ + if (r < 0) r = -r; + this->r = r; + appearance->setRadius(r); + geometry->setRadius(r); +} + +SphereAppearance::SphereAppearance(void){ + setRadius(1); +} + +void SphereAppearance::setRadius(float r){ + if (r < 0) r = -r; + this->r = r; +} + +void Sphere::setColor(float red, float green, float blue){ + appearance->getMaterial()->setColor(red, green, blue, 1); +} + +void SphereAppearance::draw(void){ + material.enable(); + createSphere(r); +} + + + + +SphereShape::SphereShape(Object *sphere) : Shape(sphere){ + setRadius(1); +} + +void SphereShape::setRadius(float r){ + this->r = r; +} + +float SphereShape::getRadius(void){ + return r; +} + +bool SphereShape::checkCollision(Object *target){ + return target->geometry->checkCollisionPeer(this); +} + +float SphereShape::calculateMomentOfInertia(float *rotationvector){ + return 2.0/3.0*r*r; +} + +/*bool SphereShape::checkCollisionPeer(PlaneShape *target){ + float sourceposition[3], targetposition[3]; + object->getPosition(sourceposition); + target->object->getPosition(targetposition); + float height = target->height + targetposition[1]; + + if (sourceposition[1] - r < height){ + //shotsound->play(); + float normal[3] = {0, 1, 0}; + + float contactpoint[3] = {0, target->height, 0}; + collide(object, target->object, normal, contactpoint); + return true; + } + + return false; +}*/ + +bool SphereShape::checkCollisionPeer(SphereShape *target){ + /*float sourceposition[3], targetposition[3]; + object->getPosition(sourceposition); + target->object->getPosition(targetposition); + float impact[3]; + vectorSub(impact, sourceposition, targetposition);*/ + float impact[3] = {0, 0, 0}; + object->transformPoint(impact, impact); + target->object->unTransformPoint(impact, impact); + float distance2 = vectorDot(impact, impact); + + if (distance2 < (r + target->r)*(r + target->r)){ + /*float temp[3], temp2[3], temp3[3]; + object->getMomentum(temp2); + target->object->getMomentum(temp3); + vectorSub(temp, temp2, temp3); + shotsound->setVolume(1.0-1/(1+vectorLength(temp)*0.5)); + shotsound->play();*/ + float normal[3]; + vectorNormalize(normal, impact); + + float contactpoint[3]; + vectorScale(contactpoint, normal, target->r); + + target->object->transformVector(normal, normal); + target->object->transformPoint(contactpoint, contactpoint); + + addCollision(object, target->object, normal, contactpoint); + + //vectorAdd(contactnormal, normal); + + return true; + } + + return false; +} + +bool between(float x, float x1, float x2){ + if ((x >= x1 && x <=x2) || (x >= x2 && x <=x1)) return true; + return false; +} + +/*bool SphereShape::checkCollisionPeer(BoxShape *target){ + float sourceposition[3], targetposition[3]; + object->getPosition(sourceposition); + target->object->getPosition(targetposition); + float x1 = target->x1 + targetposition[0]; + float x2 = target->x2 + targetposition[0]; + float y1 = target->y1 + targetposition[1]; + float y2 = target->y2 + targetposition[1]; + float z1 = target->z1 + targetposition[2]; + float z2 = target->z2 + targetposition[2]; + float points[3][2] = {{x1, x2}, {y1, y2}, {z1, z2}}; + float p[2], op1[2], op2[2]; + float c, oc1, oc2; + int i; + float normal[3]; + float *normal2[3]; + //Faces + for (i = 0; i < 3; i++){ + p[0] = points[i][0]; + p[1] = points[i][1]; + op1[0] = points[(i+1)%3][0]; + op1[1] = points[(i+1)%3][1]; + op2[0] = points[(i+2)%3][0]; + op2[1] = points[(i+2)%3][1]; + c = sourceposition[i]; + oc1 = sourceposition[(i+1)%3]; + oc2 = sourceposition[(i+2)%3]; + normal2[0] = &normal[i]; + normal2[1] = &normal[(i+1)%3]; + normal2[2] = &normal[(i+2)%3]; + + if (between(oc1, op1[0], op1[1]) && + between(oc2, op2[0], op2[1])){ + if (c < p[0] && c+r > p[0]){ + *normal2[0] = -1; + *normal2[1] = 0; + *normal2[2] = 0; + collide(object, target->object, normal); + return true; + } + if (c > p[1] && c-r < p[1]){ + *normal2[0] = 1; + *normal2[1] = 0; + *normal2[2] = 0; + collide(object, target->object, normal); + return true; + } + } + } + + //Edges + for (i = 0; i < 3; i++){ + p[0] = points[i][0]; + p[1] = points[i][1]; + op1[0] = points[(i+1)%3][0]; + op1[1] = points[(i+1)%3][1]; + op2[0] = points[(i+2)%3][0]; + op2[1] = points[(i+2)%3][1]; + c = sourceposition[i]; + oc1 = sourceposition[(i+1)%3]; + oc2 = sourceposition[(i+2)%3]; + normal2[0] = &normal[i]; + normal2[1] = &normal[(i+1)%3]; + normal2[2] = &normal[(i+2)%3]; + float edges[4][2] = { + {p[0], op1[0]}, + {p[1], op1[0]}, + {p[0], op1[1]}, + {p[1], op1[1]}}; + + if (between(oc2, op2[0], op2[1])){ + int j; + for (j = 0; j < 4; j++){ + float diff[2] = {c - edges[j][0], oc1 - edges[j][1]}; + if (diff[0]*diff[0] + diff[1]*diff[1] < r*r){ + *normal2[0] = diff[0]; + *normal2[1] = diff[1]; + *normal2[2] = 0; + vectorNormalize(normal); + collide(object, target->object, normal); + return true; + } + } + } + } + + //Corners + float corners[8][3] = { + {x1, y1, z1}, + {x1, y1, z2}, + {x1, y2, z1}, + {x1, y2, z2}, + {x2, y1, z1}, + {x2, y1, z2}, + {x2, y2, z1}, + {x2, y2, z2}}; + for (i = 0; i < 8; i++){ + float *corner = corners[i]; + float difference[3]; + vectorSub(difference, sourceposition, corner); + float length2 = vectorDot(difference, difference); + if (length2 < r*r){ + float normal[3]; + vectorNormalize(normal, difference); + collide(object, target->object, normal); + return true; + } + } + + return false; +}*/ + + + +bool SphereShape::checkCollisionPeer(MeshShape *target){ + float position[3] = {0, 0, 0}; + object->transformPoint(position, position); + target->object->unTransformPoint(position, position); + Mesh *mesh = target->mesh; + + float normal[3]; + float contactpoint[3]; + + if (checkSphereMeshCollision(position, r, mesh, normal, contactpoint)){ + target->object->transformVector(normal, normal); + target->object->transformPoint(contactpoint, contactpoint); + + addCollision(object, target->object, normal, contactpoint); + + //vectorAdd(contactnormal, normal); + + return true; + } + return false; +} \ No newline at end of file diff --git a/src/sphere.h b/src/sphere.h new file mode 100644 index 0000000..08c2779 --- /dev/null +++ b/src/sphere.h @@ -0,0 +1,112 @@ +/* + * $Id: sphere.h,v 1.11 2002/07/19 20:33:29 msell Exp $ + * + * + * $Log: sphere.h,v $ + * Revision 1.11 2002/07/19 20:33:29 msell + * #pragma once -> #ifndef + * + * Revision 1.10 2002/07/07 17:53:21 msell + * Legoukon alku + * + * Revision 1.9 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.8 2002/06/30 16:05:04 msell + * Törmäyksien parantelua, transformaatioita mukana + * + * Revision 1.7 2002/06/24 14:12:15 msell + * Nyt toimii sphere -> mesh -törmäykset, ihan tosi + * + * Revision 1.6 2002/06/20 22:50:12 msell + * Meshit + * + * Revision 1.5 2002/06/15 17:18:37 msell + * Toimiva törmäystarkastus kiinteille laatikoille + * + * Revision 1.4 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.3 2002/06/11 23:11:45 msell + * Törmäystarkistusta + * + * Revision 1.2 2002/06/07 21:16:51 msell + * Fysiikkaenginen alkua + * + * Revision 1.1 2002/06/05 23:55:46 msell + * Pallo + * + * + * + * $Date: 2002/07/19 20:33:29 $ + * + */ + +#ifndef __SPHERE_H_INCLUDED__ +#define __SPHERE_H_INCLUDED__ + +#include "object.h" +#include "material.h" +#include "mesh.h" + + +class SphereAppearance; + +//Object for sphere + +class Sphere : public Object{ +private: + float r; + SphereAppearance *appearance; + SphereShape *geometry; + +public: + Sphere(void); + + void setRadius(float r); + void setColor(float red, float green, float blue); +}; + + + +//Appearance of sphere + +class SphereAppearance : public Appearance{ +private: + float r; + +public: + SphereAppearance(void); + + void setRadius(float r); + void draw(void); +}; + + + +//Geometry of sphere + +class SphereShape : public Shape{ +private: + float r; + +public: + SphereShape(Object *sphere); + + void setRadius(float r); + float getRadius(void); + + float calculateMomentOfInertia(float *rotationvector); + + bool checkCollision(Object *target); + + bool checkCollisionPeer(SphereShape *target); + bool checkCollisionPeer(MeshShape *target); + + friend class Sphere; + friend class MeshShape; +}; + +#endif + diff --git a/src/texture.cpp b/src/texture.cpp new file mode 100644 index 0000000..7c56eff --- /dev/null +++ b/src/texture.cpp @@ -0,0 +1,127 @@ +/* + * $Id: texture.cpp,v 1.7 2002/07/17 16:40:33 msell Exp $ + * + * + * $Log: texture.cpp,v $ + * Revision 1.7 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.6 2002/06/27 21:43:50 jkaarlas + * lisätty setId-funktio + * + * Revision 1.5 2002/06/20 15:27:48 jkaarlas + * bindtexture siirretty oikeaan paikkaan + * + * Revision 1.4 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.3 2002/06/19 22:45:29 jkaarlas + * nyt nämä menee järkevästi + * + * Revision 1.2 2002/06/15 22:04:01 jkaarlas + * tähänkin jotain sisältöä + * + * + * + * + * $Date: 2002/07/17 16:40:33 $ + * + */ + +#include "texture.h" +#include "graphics.h" + +Texture::Texture(void){ + this->textureId = -1; + this->enabled = false; +} + +Texture::~Texture(void){ + if (textureId != -1){ + DRUID.freeTexture(textureId); + textureId = -1; + enabled = false; + } +} + +Texture::Texture(int id){ + if (id > -1){ + this->textureId = id; + this->enabled = false; + } + else{ + this->textureId = -1; + this->enabled = false; + } +} + +bool Texture::loadImage(char* path){ + format = GL_RGB; + + texture = IMG_Load(path); + + //texture = SDL_DisplayFormatAlpha(texture); + + this->textureId = DRUID.loadTexture(texture, -1); + //this->textureId = DRUID.loadTexture(path, -1); + this->enable(); + return this->isValidId(); +} + +bool Texture::loadImage(char* path, float *trans){ + format = GL_RGBA; + + texture = IMG_Load(path); + + Uint32 colorKey = SDL_MapRGB(texture->format, + (Uint8)(trans[0] * 255), + (Uint8)(trans[1] * 255), + (Uint8)(trans[2] * 255)); + //SDL_SetAlpha(texture, 0, SDL_ALPHA_OPAQUE); + + SDL_SetColorKey(texture, SDL_SRCCOLORKEY, colorKey); + + //SDL_Surface* alphaSurface = SDL_DisplayFormatAlpha(texture); + texture = SDL_DisplayFormatAlpha(texture); + + this->textureId = DRUID.loadTexture(texture, -1, format); + this->enable(); + return this->isValidId(); +} + +void Texture::reload(void){ + this->textureId = DRUID.loadTexture(texture, -1, format); + this->enable(); +} + +void Texture::disable(void){ + this->enabled = false; + glDisable(GL_TEXTURE_2D); +} + +void Texture::enable(void){ + if (textureId > -1){ + this->enabled = true; + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, textureId); + } +} + +bool Texture::isEnabled(void){ + return this->enabled; +} + +int Texture::getId(void){ + return this->textureId; +} + +void Texture::setId(int id){ + if (id > -1){ + this->textureId = id; + this->enable(); + } +} + +bool Texture::isValidId(void){ + return (this->textureId > -1); +} diff --git a/src/texture.h b/src/texture.h new file mode 100644 index 0000000..c5f3b56 --- /dev/null +++ b/src/texture.h @@ -0,0 +1,67 @@ +/* + * $Id: texture.h,v 1.8 2002/07/19 20:33:29 msell Exp $ + * + * + * $Log: texture.h,v $ + * Revision 1.8 2002/07/19 20:33:29 msell + * #pragma once -> #ifndef + * + * Revision 1.7 2002/07/17 16:40:33 msell + * Resoluution vaihto + * + * Revision 1.6 2002/06/27 21:43:50 jkaarlas + * lisätty setId-funktio + * + * Revision 1.5 2002/06/20 00:21:01 jkaarlas + * materiaali- ja tekstuurihommia edistetty + * + * Revision 1.4 2002/06/19 22:45:29 jkaarlas + * nyt nämä menee järkevästi + * + * Revision 1.3 2002/06/15 22:52:32 jkaarlas + * tekstuurimanageri ja työkalupakki + * + * + * + * $Date: 2002/07/19 20:33:29 $ + * + */ + +#ifndef __TEXTURE_H_INCLUDED__ +#define __TEXTURE_H_INCLUDED__ + +#include +#include "main.h" +class Texture{ + +public: + + Texture(void); + Texture(int id); + ~Texture(void); + + bool loadImage(char* path); + bool loadImage(char* path, float *trans); + void enable(void); + void disable(void); + bool isEnabled(void); + int getId(void); + void setId(int id); + bool isValidId(void); + void reload(void); + + //int* getOGLTexture(void); + //int* getModifiableOGLTexture(void); + +private: + + int textureId; + //int* modTexture; + bool enabled; + + SDL_Surface *texture; + int format; +}; + +#endif + diff --git a/src/utils.cpp b/src/utils.cpp new file mode 100644 index 0000000..df8d8ef --- /dev/null +++ b/src/utils.cpp @@ -0,0 +1,59 @@ +/* + * $Id: utils.cpp,v 1.3 2002/07/14 21:40:43 msell Exp $ + * + * + * $Log: utils.cpp,v $ + * Revision 1.3 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.2 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.1 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * + * + * $Date: 2002/07/14 21:40:43 $ + * + */ + +#include + +void swapInt(int *a, int *b){ + int temp = *a; + *a = *b; + *b = temp; +} + +void swapFloat(float *a, float *b){ + float temp = *a; + *a = *b; + *b = temp; +} + +int random(int x){ + return rand() * x / RAND_MAX; +} + +float randomf(float x){ + return rand() * x / RAND_MAX; +} + +int smod(int val, int mod){ + if (val>=0) return val%mod; + int temp=-val/mod+1; + return (val+temp*mod)%mod; +} + +double sdes(double val){ + if (val>=0) return val-(int)(val); + return val-(int)(val)+1; +} + +double sfmod(double val, double mod){ + val-=(int)(val/mod)*mod; + if (val<0) val+=mod; + return val; +} + diff --git a/src/utils.h b/src/utils.h new file mode 100644 index 0000000..be9aa05 --- /dev/null +++ b/src/utils.h @@ -0,0 +1,45 @@ +/* + * $Id: utils.h,v 1.6 2002/07/19 20:33:29 msell Exp $ + * + * + * $Log: utils.h,v $ + * Revision 1.6 2002/07/19 20:33:29 msell + * #pragma once -> #ifndef + * + * Revision 1.5 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.4 2002/06/14 00:05:05 msell + * Törmäyssimulaatio kunnossa toivon mukaan + * + * Revision 1.3 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.2 2002/06/03 23:06:38 msell + * no message + * + * Revision 1.1 2002/06/02 16:57:37 msell + * Objektirakenteen pohja + * + * + * + * $Date: 2002/07/19 20:33:29 $ + * + */ + +#ifndef __UTILS_H_INCLUDED__ +#define __UTILS_H_INCLUDED__ + + +#define PI 3.14159265358979323846 + +void swapInt(int *a, int *b); +void swapFloat(float *a, float *b); +int random(int x); +float randomf(float x); +int smod(int val, int mod); +double sdes(double val); +double sfmod(double val, double mod); + +#endif + diff --git a/src/vector.cpp b/src/vector.cpp new file mode 100644 index 0000000..28f40aa --- /dev/null +++ b/src/vector.cpp @@ -0,0 +1,308 @@ +/* + * $Id: vector.cpp,v 1.7 2002/07/14 21:40:43 msell Exp $ + * + * + * $Log: vector.cpp,v $ + * Revision 1.7 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.6 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * Revision 1.5 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.4 2002/06/23 20:12:19 msell + * Parempi törmäystarkistus palloista mesheihin + * + * Revision 1.3 2002/06/17 12:42:46 msell + * Hieman parempi törmäysmallinnus taas + * + * Revision 1.2 2002/06/11 23:23:03 msell + * Törmäystarkistusta + * + * Revision 1.1 2002/05/16 18:42:07 msell + * Vektorifunctioita ja kamera + * + * + * + * $Date: 2002/07/14 21:40:43 $ + * + */ + + +#include + +#include "main.h" +#include "vector.h" +#include "utils.h" + +void vectorSet(float *target, float x, float y, float z){ + target[0] = x; + target[1] = y; + target[2] = z; +} + +void vectorCopy(float *target, float *source){ + target[0] = source[0]; + target[1] = source[1]; + target[2] = source[2]; +} + +void vectorAdd(float *target, float *source1, float *source2){ + target[0] = source1[0] + source2[0]; + target[1] = source1[1] + source2[1]; + target[2] = source1[2] + source2[2]; +} + +void vectorAdd(float *target, float *source){ + target[0] += source[0]; + target[1] += source[1]; + target[2] += source[2]; +} + +void vectorSub(float *target, float *source1, float *source2){ + target[0] = source1[0] - source2[0]; + target[1] = source1[1] - source2[1]; + target[2] = source1[2] - source2[2]; +} + +void vectorSub(float *target, float *source){ + target[0] -= source[0]; + target[1] -= source[1]; + target[2] -= source[2]; +} + +void vectorNegative(float *target, float *source){ + target[0] = -source[0]; + target[1] = -source[1]; + target[2] = -source[2]; +} + +void vectorNegative(float *target){ + target[0] = -target[0]; + target[1] = -target[1]; + target[2] = -target[2]; +} + +void vectorScale(float *target, float *source, float scale){ + target[0] = source[0] * scale; + target[1] = source[1] * scale; + target[2] = source[2] * scale; +} + +void vectorScale(float *target, float scale){ + target[0] *= scale; + target[1] *= scale; + target[2] *= scale; +} + +float vectorDot(float *source1, float *source2){ + return source1[0]*source2[0] + source1[1]*source2[1] + source1[2]*source2[2]; +} + +float vectorNormalizedDot(float *source1, float *source2){ + return vectorDot(source1, source2) / (vectorLength(source1) * vectorLength(source2)); +} + +float vectorLength(float *source){ + return sqrtf(vectorDot(source, source)); +} + +void vectorCross(float *target, float *source1, float *source2){ + target[0] = source1[1]*source2[2] - source1[2]*source2[1]; + target[1] = source1[2]*source2[0] - source1[0]*source2[2]; + target[2] = source1[0]*source2[1] - source1[1]*source2[0]; +} + +void vectorNormalize(float *target, float *source){ + vectorScale(target, source, 1.0/vectorLength(source)); +} + +void vectorNormalize(float *target){ + vectorScale(target, 1.0/vectorLength(target)); +} + +void vectorReflect(float *target, float *source, float *normal){ + vectorCopy(target, normal); + vectorScale(target, -vectorDot(source, normal)*2); + vectorAdd(target, source); +} + +void vectorProject(float *target, float *source1, float *source2){ + vectorScale(target, source2, vectorDot(source1, source2) / vectorDot(source2, source2)); +} + +bool vectorIsZero(float *vector){ + if (vector[0] == 0 && vector[1] == 0 && vector[2] == 0) return true; + //if (vectorDot(vector, vector) < 0.00001) return true; + else return false; +} + +void vectorSaturate(float *target, float *source, float min, float max){ + float len = vectorLength(source); + if (len < min){ + len = min; + } else if (len > max){ + len = max; + } else{ + if (target != source) vectorCopy(target, source); + return; + } + vectorNormalize(target, source); + vectorScale(target, len); +} + +void vectorSaturate(float *vector, float min, float max){ + vectorSaturate(vector, vector, min, max); +} + +void vectorMatrixMultiply(float *target, float *source, float *matrix){ + float source2[3]; + if (source == target){ + vectorCopy(source2, source); + source = source2; + } + int x; + for (x = 0; x < 3; x++){ + target[x] = source[0]*matrix[0+x] + + source[1]*matrix[3+x] + + source[2]*matrix[6+x]; + } +} + + + +void matrixSet(float *matrix, + float x1, float y1, float z1, + float x2, float y2, float z2, + float x3, float y3, float z3){ + matrix[0] = x1; + matrix[1] = y1; + matrix[2] = z1; + matrix[3] = x2; + matrix[4] = y2; + matrix[5] = z2; + matrix[6] = x3; + matrix[7] = y3; + matrix[8] = z3; +} + +void matrixSet(float *matrix, float *r1, float *r2, float *r3){ + vectorCopy(&matrix[0], r1); + vectorCopy(&matrix[3], r2); + vectorCopy(&matrix[6], r3); +} + +void matrixCopy(float *target, float *source){ + target[0] = source[0]; + target[1] = source[1]; + target[2] = source[2]; + target[3] = source[3]; + target[4] = source[4]; + target[5] = source[5]; + target[6] = source[6]; + target[7] = source[7]; + target[8] = source[8]; +} + +void matrixIdentity(float *matrix){ + matrixSet(matrix, 1, 0, 0, 0, 1, 0, 0, 0, 1); +} + +void matrixAdd(float *target, float *source1, float *source2){ + target[0] = source1[0] + source2[0]; + target[1] = source1[1] + source2[1]; + target[2] = source1[2] + source2[2]; + target[3] = source1[3] + source2[3]; + target[4] = source1[4] + source2[4]; + target[5] = source1[5] + source2[5]; + target[6] = source1[6] + source2[6]; + target[7] = source1[7] + source2[7]; + target[8] = source1[8] + source2[8]; +} + +void matrixAdd(float *target, float *source){ + target[0] += source[0]; + target[1] += source[1]; + target[2] += source[2]; + target[3] += source[3]; + target[4] += source[4]; + target[5] += source[5]; + target[6] += source[6]; + target[7] += source[7]; + target[8] += source[8]; +} + +void matrixMultiply(float *target, float *source1, float *source2){ + float target2[9]; + float *oldtarget = target; + bool copy = false; + if (source1 == target || source2 == target){ + copy = true; + target = target2; + } + int x, y; + for (y = 0; y < 3; y++){ + for (x = 0; x < 3; x++){ + *target = source1[y*3+0]*source2[x] + + source1[y*3+1]*source2[3+x] + + source1[y*3+2]*source2[6+x]; + target++; + } + } + if (copy){ + matrixCopy(oldtarget, target2); + } +} + +/*void matrixMultiply(float *target, float *source){ + matrixMultiply(target, source, source); +}*/ + +/*void matrixRotate(float *matrix, float *vector){ + float rotmat[9]; + createRotationMatrix(rotmat, vector); + matrixMultiply(matrix, matrix, rotmat); +}*/ + +void matrixCreateRotation(float *matrix, float *vector){ + float angle = vectorLength(vector); + float n[3]; + vectorNormalize(n, vector); + + float c = cos(angle); + float s = sin(angle); + float t = 1 - c; + + float x = n[0]; + float y = n[1]; + float z = n[2]; + + matrixSet(matrix, + t*x*x + c, t*y*x + s*z, t*z*x - s*y, + t*x*y - s*z, t*y*y + c, t*z*y + s*x, + t*x*z + s*y, t*y*z - s*x, t*z*z + c); + +} + +void matrixTranspose(float *target, float *source){ + target[0] = source[0]; target[1] = source[3]; target[2] = source[6]; + target[3] = source[1]; target[4] = source[4]; target[5] = source[7]; + target[6] = source[2]; target[7] = source[5]; target[8] = source[8]; +} + + +/*void rotatePointAroundVector(float *target, float *point, float *vector){ + float angle = vectorLength(vector); + float n[3]; + vectorNormalize(n, vector); + + float c = cos(angle); + float s = sin(angle); + float t = 1 - c; + + //r' = r*c + n*(n . r)*t + (r x n)*s +}*/ + diff --git a/src/vector.h b/src/vector.h new file mode 100644 index 0000000..e868623 --- /dev/null +++ b/src/vector.h @@ -0,0 +1,85 @@ +/* + * $Id: vector.h,v 1.8 2002/07/19 20:33:29 msell Exp $ + * + * + * $Log: vector.h,v $ + * Revision 1.8 2002/07/19 20:33:29 msell + * #pragma once -> #ifndef + * + * Revision 1.7 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.6 2002/06/27 00:08:04 msell + * Kimmotukset palloille myös pyöritettyihin mesheihin + * + * Revision 1.5 2002/06/23 20:12:19 msell + * Parempi törmäystarkistus palloista mesheihin + * + * Revision 1.4 2002/06/17 12:42:46 msell + * Hieman parempi törmäysmallinnus taas + * + * Revision 1.3 2002/06/11 23:23:03 msell + * Törmäystarkistusta + * + * Revision 1.2 2002/06/04 16:28:32 msell + * #pragma once + * + * Revision 1.1 2002/05/16 18:42:07 msell + * Vektorifunctioita ja kamera + * + * + * + * $Date: 2002/07/19 20:33:29 $ + * + */ + +#ifndef __VECTOR_H_INCLUDED__ +#define __VECTOR_H_INCLUDED__ + +#include "main.h" + +void vectorSet(float *target, float x, float y, float z); +void vectorCopy(float *target, float *source); +void vectorAdd(float *target, float *source1, float *source2); +void vectorAdd(float *target, float *source); +void vectorSub(float *target, float *source); +void vectorSub(float *target, float *source1, float *source2); +void vectorNegative(float *target, float *source); +void vectorNegative(float *target); +void vectorScale(float *target, float *source, float scale); +void vectorScale(float *target, float scale); +float vectorDot(float *source1, float *source2); +float vectorNormalizedDot(float *source1, float *source2); +float vectorLength(float *source); +void vectorCross(float *target, float *source1, float *source2); +void vectorNormalize(float *target, float *source); +void vectorNormalize(float *target); +void vectorReflect(float *target, float *source, float *normal); +bool vectorIsZero(float *vector); +void vectorSaturate(float *target, float *source, float min, float max); +void vectorSaturate(float *vector, float min, float max); + +//Projects vector source1 onto vector source2 +void vectorProject(float *target, float *source1, float *source2); + +void vectorMatrixMultiply(float *target, float *source, float *matrix); + + + +void matrixSet(float *matrix, + float x1, float y1, float z1, + float x2, float y2, float z2, + float x3, float y3, float z3); +void matrixSet(float *matrix, float *r1, float *r2, float *r3); +void matrixCopy(float *target, float *source); +void matrixIdentity(float *matrix); +void matrixAdd(float *target, float *source1, float *source2); +void matrixAdd(float *target, float *source); +void matrixMultiply(float *target, float *source1, float *source2); +//void matrixMultiply(float *target, float *source); +void matrixRotate(float *matrix, float *vector); +void matrixCreateRotation(float *matrix, float *vector); +void matrixTranspose(float *target, float *source); + +#endif + diff --git a/src/world.cpp b/src/world.cpp new file mode 100644 index 0000000..7ea7717 --- /dev/null +++ b/src/world.cpp @@ -0,0 +1,250 @@ +/* + * $Id: world.cpp,v 1.9 2002/07/18 23:05:31 msell Exp $ + * + * + * $Log: world.cpp,v $ + * Revision 1.9 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.8 2002/07/15 20:32:36 msell + * Uudet valot ja ulkoasun parantelua + * + * Revision 1.7 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.6 2002/07/14 21:40:43 msell + * Conflictit pois, liikkumiset (hyppy, kävely, lyönti), uusi areena + * + * Revision 1.5 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.4 2002/07/08 18:28:47 msell + * Törmäystä ja ukkoja + * + * Revision 1.3 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.2 2002/07/07 15:29:07 msell + * Törmäyksien parantelua + * + * Revision 1.1 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * + * + * $Date: 2002/07/18 23:05:31 $ + * + */ + +#include "world.h" + +#include "object.h" +#include "collision.h" +#include "vector.h" + +World::World(void){ + childlist = NULL; + linklist = NULL; + maxparticles = 500; + particles = new Particle *[maxparticles]; + particlecount = 0; +} + +void World::prepare(void){ + objectlist *node = childlist; + childcount = 0; + while (node != NULL){ + Object *child = node->object; + child->prepare(); + node = node->next; + childcount++; + } + + childs = new Object *[childcount]; + node = childlist; + int i = 0; + while (node != NULL){ + Object *child = node->object; + childs[i] = child; + node = node->next; + i++; + } + + contacts = new Contact[MAXCONTACTS];//childcount*childcount]; +} + +#define GRAVITY 9.81 +//#define GRAVITY 15 + +void World::move(void){ + int i, j; + + + //Gravity + float gravity[3]; + vectorSet(gravity, 0, 0, 0); + for (i = 0; i < childcount; i++){ + Object *object = childs[i]; + if (object->gravity){ + gravity[1] = -object->getMass()*GRAVITY; + object->addExternalForce(gravity); + } + } + + /*for (i = 0; i < particlecount; i++){ + Particle *object = particles[i]; + if (object->gravity){ + gravity[1] = -object->getMass()*GRAVITY; + object->addExternalForce(gravity); + } + }*/ + + + //Collisions + contactcount = 0; + + for (i = 0; i < childcount; i++){ + Object *object1 = childs[i]; + int group1 = object1->getCollisionGroup(); + for (j = i+1; j < childcount; j++){ + Object *object2 = childs[j]; + int group2 = object2->getCollisionGroup(); + + if (isCollisionLink(group1, group2)){ + object2->geometry->checkCollision(object1); + } + } + } + + /*for (i = 0; i < particlecount; i++){ + Particle *object1 = particles[i]; + int group1 = object1->getCollisionGroup(); + for (j = 0; j < childcount; j++){ + Object *object2 = childs[j]; + int group2 = object2->getCollisionGroup(); + + if (isCollisionLink(group1, group2)){ + object2->geometry->checkCollision(object1); + } + } + }*/ + + //printf("Contacts: %i\n", contactcount); + + + bool contactresponse; + + j = 0; + do{ + contactresponse = false; + + //Links between objects + objectlinklist *node = linklist; + while (node != NULL){ + ObjectLink *link = node->link; + if (handleLink(link)) contactresponse = true; + node = node->next; + } + + //Collision contact + for (i = 0; i < contactcount; i++){ + Contact *contact = &contacts[i]; + if (handleCollision(contact)) contactresponse = true; + } + + j++; + } while (contactresponse && j < 10); + + /*j = 0; + do{ + contactresponse = false; + + //Collision contact + for (i = 0; i < contactcount; i++){ + Contact *contact = &contacts[i]; + if (handleCollision(contact)) contactresponse = true; + } + + j++; + } while (contactresponse && j < 10);*/ + + /*j = 0; + do{ + contactresponse = false; + + //Links between objects + objectlinklist *node = linklist; + while (node != NULL){ + ObjectLink *link = node->link; + if (handleLink(link)) contactresponse = true; + node = node->next; + } + + j++; + } while (contactresponse && j < 3);*/ + + + for (i = 0; i < childcount; i++){ + childs[i]->move(); + } + for (i = 0; i < particlecount; i++){ + particles[i]->move(); + } +} + +void World::draw(void){ + int i; + for (i = 0; i < childcount; i++) childs[i]->draw(); + for (i = 0; i < particlecount; i++) particles[i]->draw(); +} + +void World::addChild(Object *child){ + objectlist *node = new objectlist; + node->object = child; + node->next = childlist; + childlist = node; +} + +void World::addParticle(Particle *particle){ + if (particlecount < maxparticles){ + particles[particlecount++] = particle; + } +} + +void World::removeParticle(Particle *particle){ + int i; + for (i = 0; i < particlecount; i++){ + if (particles[i] == particle){ + particles[i] = particles[particlecount-1]; + particlecount--; + break; + } + } +} + +ObjectLink *World::addLink(Object *object1, Object *object2, float *point){ + ObjectLink *link = new ObjectLink(); + link->object1 = object1; + link->object2 = object2; + if (point != NULL){ + object1->unTransformPoint(link->point1, point); + object2->unTransformPoint(link->point2, point); + link->enabled = true; + } else{ + link->enabled = false; + } + objectlinklist *node = new objectlinklist; + node->link = link; + node->next = linklist; + linklist = node; + return link; +} + +void World::renewLink(ObjectLink *link, float *point){ + link->object1->unTransformPoint(link->point1, point); + link->object2->unTransformPoint(link->point2, point); + link->enabled = true; +} + + diff --git a/src/world.h b/src/world.h new file mode 100644 index 0000000..8de0579 --- /dev/null +++ b/src/world.h @@ -0,0 +1,86 @@ +/* + * $Id: world.h,v 1.6 2002/07/19 20:33:29 msell Exp $ + * + * + * $Log: world.h,v $ + * Revision 1.6 2002/07/19 20:33:29 msell + * #pragma once -> #ifndef + * + * Revision 1.5 2002/07/18 23:05:31 msell + * Partikkelit ja kakkospelaajan liike + * + * Revision 1.4 2002/07/15 15:22:08 msell + * Parantelua + * + * Revision 1.3 2002/07/10 17:13:44 msell + * Törmäystarkastelun parantelua + * + * Revision 1.2 2002/07/07 23:05:22 msell + * Osien liimaaminen toisiinsa (kesken) + * + * Revision 1.1 2002/07/04 21:05:41 msell + * Se toimii!! =) + * Törmäystarkistukset siis + * + * + * + * $Date: 2002/07/19 20:33:29 $ + * + */ + +#ifndef __WORLD_H_INCLUDED__ +#define __WORLD_H_INCLUDED__ + +class World; +class ObjectLink; + +#include "object.h" +#include "particle.h" + +class ObjectLink{ +public: + Object *object1, *object2; + float point1[3], point2[3]; + bool enabled; +}; + +struct objectlinklist{ + ObjectLink *link; + objectlinklist *next; +}; + +#define MAXCONTACTS 100 + +class World{ +private: + objectlist *childlist; + + int childcount; + Object **childs; + + + int particlecount; + int maxparticles; + Particle **particles; + + + objectlinklist *linklist; +public: + World(void); + + void prepare(void); + void move(void); + void draw(void); + + void addChild(Object *child); + + void addParticle(Particle *particle); + void removeParticle(Particle *particle); + + //Point is world-relative + ObjectLink *addLink(Object *object1, Object *object2, float *point); + void renewLink(ObjectLink *link, float *point); +}; + +#endif +