diff --git a/Demos/GimpactTestDemo/BunnyMesh.h b/Demos/GimpactTestDemo/BunnyMesh.h new file mode 100644 index 000000000..46ba2c61c --- /dev/null +++ b/Demos/GimpactTestDemo/BunnyMesh.h @@ -0,0 +1,1379 @@ +#ifndef BUNNY_MESH_H_ +#define BUNNY_MESH_H_ + + + +//***************************THE FAMOUS BUNNY TRIMESH********************************************// + +#define REAL btScalar +const int BUNNY_NUM_TRIANGLES =902; +const int BUNNY_NUM_VERTICES = 453; +const int BUNNY_NUM_INDICES = BUNNY_NUM_TRIANGLES * 3; + + +REAL gVerticesBunny[BUNNY_NUM_VERTICES * 3] = { + REAL(-0.334392), REAL(0.133007), REAL(0.062259), + REAL(-0.350189), REAL(0.150354), REAL(-0.147769), + REAL(-0.234201), REAL(0.343811), REAL(-0.174307), + REAL(-0.200259), REAL(0.285207), REAL(0.093749), + REAL(0.003520), REAL(0.475208), REAL(-0.159365), + REAL(0.001856), REAL(0.419203), REAL(0.098582), + REAL(-0.252802), REAL(0.093666), REAL(0.237538), + REAL(-0.162901), REAL(0.237984), REAL(0.206905), + REAL(0.000865), REAL(0.318141), REAL(0.235370), + REAL(-0.414624), REAL(0.164083), REAL(-0.278254), + REAL(-0.262213), REAL(0.357334), REAL(-0.293246), + REAL(0.004628), REAL(0.482694), REAL(-0.338626), + REAL(-0.402162), REAL(0.133528), REAL(-0.443247), + REAL(-0.243781), REAL(0.324275), REAL(-0.436763), + REAL(0.005293), REAL(0.437592), REAL(-0.458332), + REAL(-0.339884), REAL(-0.041150), REAL(-0.668211), + REAL(-0.248382), REAL(0.255825), REAL(-0.627493), + REAL(0.006261), REAL(0.376103), REAL(-0.631506), + REAL(-0.216201), REAL(-0.126776), REAL(-0.886936), + REAL(-0.171075), REAL(0.011544), REAL(-0.881386), + REAL(-0.181074), REAL(0.098223), REAL(-0.814779), + REAL(-0.119891), REAL(0.218786), REAL(-0.760153), + REAL(-0.078895), REAL(0.276780), REAL(-0.739281), + REAL(0.006801), REAL(0.310959), REAL(-0.735661), + REAL(-0.168842), REAL(0.102387), REAL(-0.920381), + REAL(-0.104072), REAL(0.177278), REAL(-0.952530), + REAL(-0.129704), REAL(0.211848), REAL(-0.836678), + REAL(-0.099875), REAL(0.310931), REAL(-0.799381), + REAL(0.007237), REAL(0.361687), REAL(-0.794439), + REAL(-0.077913), REAL(0.258753), REAL(-0.921640), + REAL(0.007957), REAL(0.282241), REAL(-0.931680), + REAL(-0.252222), REAL(-0.550401), REAL(-0.557810), + REAL(-0.267633), REAL(-0.603419), REAL(-0.655209), + REAL(-0.446838), REAL(-0.118517), REAL(-0.466159), + REAL(-0.459488), REAL(-0.093017), REAL(-0.311341), + REAL(-0.370645), REAL(-0.100108), REAL(-0.159454), + REAL(-0.371984), REAL(-0.091991), REAL(-0.011044), + REAL(-0.328945), REAL(-0.098269), REAL(0.088659), + REAL(-0.282452), REAL(-0.018862), REAL(0.311501), + REAL(-0.352403), REAL(-0.131341), REAL(0.144902), + REAL(-0.364126), REAL(-0.200299), REAL(0.202388), + REAL(-0.283965), REAL(-0.231869), REAL(0.023668), + REAL(-0.298943), REAL(-0.155218), REAL(0.369716), + REAL(-0.293787), REAL(-0.121856), REAL(0.419097), + REAL(-0.290163), REAL(-0.290797), REAL(0.107824), + REAL(-0.264165), REAL(-0.272849), REAL(0.036347), + REAL(-0.228567), REAL(-0.372573), REAL(0.290309), + REAL(-0.190431), REAL(-0.286997), REAL(0.421917), + REAL(-0.191039), REAL(-0.240973), REAL(0.507118), + REAL(-0.287272), REAL(-0.276431), REAL(-0.065444), + REAL(-0.295675), REAL(-0.280818), REAL(-0.174200), + REAL(-0.399537), REAL(-0.313131), REAL(-0.376167), + REAL(-0.392666), REAL(-0.488581), REAL(-0.427494), + REAL(-0.331669), REAL(-0.570185), REAL(-0.466054), + REAL(-0.282290), REAL(-0.618140), REAL(-0.589220), + REAL(-0.374238), REAL(-0.594882), REAL(-0.323298), + REAL(-0.381071), REAL(-0.629723), REAL(-0.350777), + REAL(-0.382112), REAL(-0.624060), REAL(-0.221577), + REAL(-0.272701), REAL(-0.566522), REAL(0.259157), + REAL(-0.256702), REAL(-0.663406), REAL(0.286079), + REAL(-0.280948), REAL(-0.428359), REAL(0.055790), + REAL(-0.184974), REAL(-0.508894), REAL(0.326265), + REAL(-0.279971), REAL(-0.526918), REAL(0.395319), + REAL(-0.282599), REAL(-0.663393), REAL(0.412411), + REAL(-0.188329), REAL(-0.475093), REAL(0.417954), + REAL(-0.263384), REAL(-0.663396), REAL(0.466604), + REAL(-0.209063), REAL(-0.663393), REAL(0.509344), + REAL(-0.002044), REAL(-0.319624), REAL(0.553078), + REAL(-0.001266), REAL(-0.371260), REAL(0.413296), + REAL(-0.219753), REAL(-0.339762), REAL(-0.040921), + REAL(-0.256986), REAL(-0.282511), REAL(-0.006349), + REAL(-0.271706), REAL(-0.260881), REAL(0.001764), + REAL(-0.091191), REAL(-0.419184), REAL(-0.045912), + REAL(-0.114944), REAL(-0.429752), REAL(-0.124739), + REAL(-0.113970), REAL(-0.382987), REAL(-0.188540), + REAL(-0.243012), REAL(-0.464942), REAL(-0.242850), + REAL(-0.314815), REAL(-0.505402), REAL(-0.324768), + REAL(0.002774), REAL(-0.437526), REAL(-0.262766), + REAL(-0.072625), REAL(-0.417748), REAL(-0.221440), + REAL(-0.160112), REAL(-0.476932), REAL(-0.293450), + REAL(0.003859), REAL(-0.453425), REAL(-0.443916), + REAL(-0.120363), REAL(-0.581567), REAL(-0.438689), + REAL(-0.091499), REAL(-0.584191), REAL(-0.294511), + REAL(-0.116469), REAL(-0.599861), REAL(-0.188308), + REAL(-0.208032), REAL(-0.513640), REAL(-0.134649), + REAL(-0.235749), REAL(-0.610017), REAL(-0.040939), + REAL(-0.344916), REAL(-0.622487), REAL(-0.085380), + REAL(-0.336401), REAL(-0.531864), REAL(-0.212298), + REAL(0.001961), REAL(-0.459550), REAL(-0.135547), + REAL(-0.058296), REAL(-0.430536), REAL(-0.043440), + REAL(0.001378), REAL(-0.449511), REAL(-0.037762), + REAL(-0.130135), REAL(-0.510222), REAL(0.079144), + REAL(0.000142), REAL(-0.477549), REAL(0.157064), + REAL(-0.114284), REAL(-0.453206), REAL(0.304397), + REAL(-0.000592), REAL(-0.443558), REAL(0.285401), + REAL(-0.056215), REAL(-0.663402), REAL(0.326073), + REAL(-0.026248), REAL(-0.568010), REAL(0.273318), + REAL(-0.049261), REAL(-0.531064), REAL(0.389854), + REAL(-0.127096), REAL(-0.663398), REAL(0.479316), + REAL(-0.058384), REAL(-0.663401), REAL(0.372891), + REAL(-0.303961), REAL(0.054199), REAL(0.625921), + REAL(-0.268594), REAL(0.193403), REAL(0.502766), + REAL(-0.277159), REAL(0.126123), REAL(0.443289), + REAL(-0.287605), REAL(-0.005722), REAL(0.531844), + REAL(-0.231396), REAL(-0.121289), REAL(0.587387), + REAL(-0.253475), REAL(-0.081797), REAL(0.756541), + REAL(-0.195164), REAL(-0.137969), REAL(0.728011), + REAL(-0.167673), REAL(-0.156573), REAL(0.609388), + REAL(-0.145917), REAL(-0.169029), REAL(0.697600), + REAL(-0.077776), REAL(-0.214247), REAL(0.622586), + REAL(-0.076873), REAL(-0.214971), REAL(0.696301), + REAL(-0.002341), REAL(-0.233135), REAL(0.622859), + REAL(-0.002730), REAL(-0.213526), REAL(0.691267), + REAL(-0.003136), REAL(-0.192628), REAL(0.762731), + REAL(-0.056136), REAL(-0.201222), REAL(0.763806), + REAL(-0.114589), REAL(-0.166192), REAL(0.770723), + REAL(-0.155145), REAL(-0.129632), REAL(0.791738), + REAL(-0.183611), REAL(-0.058705), REAL(0.847012), + REAL(-0.165562), REAL(0.001980), REAL(0.833386), + REAL(-0.220084), REAL(0.019914), REAL(0.768935), + REAL(-0.255730), REAL(0.090306), REAL(0.670782), + REAL(-0.255594), REAL(0.113833), REAL(0.663389), + REAL(-0.226380), REAL(0.212655), REAL(0.617740), + REAL(-0.003367), REAL(-0.195342), REAL(0.799680), + REAL(-0.029743), REAL(-0.210508), REAL(0.827180), + REAL(-0.003818), REAL(-0.194783), REAL(0.873636), + REAL(-0.004116), REAL(-0.157907), REAL(0.931268), + REAL(-0.031280), REAL(-0.184555), REAL(0.889476), + REAL(-0.059885), REAL(-0.184448), REAL(0.841330), + REAL(-0.135333), REAL(-0.164332), REAL(0.878200), + REAL(-0.085574), REAL(-0.170948), REAL(0.925547), + REAL(-0.163833), REAL(-0.094170), REAL(0.897114), + REAL(-0.138444), REAL(-0.104250), REAL(0.945975), + REAL(-0.083497), REAL(-0.084934), REAL(0.979607), + REAL(-0.004433), REAL(-0.146642), REAL(0.985872), + REAL(-0.150715), REAL(0.032650), REAL(0.884111), + REAL(-0.135892), REAL(-0.035520), REAL(0.945455), + REAL(-0.070612), REAL(0.036849), REAL(0.975733), + REAL(-0.004458), REAL(-0.042526), REAL(1.015670), + REAL(-0.004249), REAL(0.046042), REAL(1.003240), + REAL(-0.086969), REAL(0.133224), REAL(0.947633), + REAL(-0.003873), REAL(0.161605), REAL(0.970499), + REAL(-0.125544), REAL(0.140012), REAL(0.917678), + REAL(-0.125651), REAL(0.250246), REAL(0.857602), + REAL(-0.003127), REAL(0.284070), REAL(0.878870), + REAL(-0.159174), REAL(0.125726), REAL(0.888878), + REAL(-0.183807), REAL(0.196970), REAL(0.844480), + REAL(-0.159890), REAL(0.291736), REAL(0.732480), + REAL(-0.199495), REAL(0.207230), REAL(0.779864), + REAL(-0.206182), REAL(0.164608), REAL(0.693257), + REAL(-0.186315), REAL(0.160689), REAL(0.817193), + REAL(-0.192827), REAL(0.166706), REAL(0.782271), + REAL(-0.175112), REAL(0.110008), REAL(0.860621), + REAL(-0.161022), REAL(0.057420), REAL(0.855111), + REAL(-0.172319), REAL(0.036155), REAL(0.816189), + REAL(-0.190318), REAL(0.064083), REAL(0.760605), + REAL(-0.195072), REAL(0.129179), REAL(0.731104), + REAL(-0.203126), REAL(0.410287), REAL(0.680536), + REAL(-0.216677), REAL(0.309274), REAL(0.642272), + REAL(-0.241515), REAL(0.311485), REAL(0.587832), + REAL(-0.002209), REAL(0.366663), REAL(0.749413), + REAL(-0.088230), REAL(0.396265), REAL(0.678635), + REAL(-0.170147), REAL(0.109517), REAL(0.840784), + REAL(-0.160521), REAL(0.067766), REAL(0.830650), + REAL(-0.181546), REAL(0.139805), REAL(0.812146), + REAL(-0.180495), REAL(0.148568), REAL(0.776087), + REAL(-0.180255), REAL(0.129125), REAL(0.744192), + REAL(-0.186298), REAL(0.078308), REAL(0.769352), + REAL(-0.167622), REAL(0.060539), REAL(0.806675), + REAL(-0.189876), REAL(0.102760), REAL(0.802582), + REAL(-0.108340), REAL(0.455446), REAL(0.657174), + REAL(-0.241585), REAL(0.527592), REAL(0.669296), + REAL(-0.265676), REAL(0.513366), REAL(0.634594), + REAL(-0.203073), REAL(0.478550), REAL(0.581526), + REAL(-0.266772), REAL(0.642330), REAL(0.602061), + REAL(-0.216961), REAL(0.564846), REAL(0.535435), + REAL(-0.202210), REAL(0.525495), REAL(0.475944), + REAL(-0.193888), REAL(0.467925), REAL(0.520606), + REAL(-0.265837), REAL(0.757267), REAL(0.500933), + REAL(-0.240306), REAL(0.653440), REAL(0.463215), + REAL(-0.309239), REAL(0.776868), REAL(0.304726), + REAL(-0.271009), REAL(0.683094), REAL(0.382018), + REAL(-0.312111), REAL(0.671099), REAL(0.286687), + REAL(-0.268791), REAL(0.624342), REAL(0.377231), + REAL(-0.302457), REAL(0.533996), REAL(0.360289), + REAL(-0.263656), REAL(0.529310), REAL(0.412564), + REAL(-0.282311), REAL(0.415167), REAL(0.447666), + REAL(-0.239201), REAL(0.442096), REAL(0.495604), + REAL(-0.220043), REAL(0.569026), REAL(0.445877), + REAL(-0.001263), REAL(0.395631), REAL(0.602029), + REAL(-0.057345), REAL(0.442535), REAL(0.572224), + REAL(-0.088927), REAL(0.506333), REAL(0.529106), + REAL(-0.125738), REAL(0.535076), REAL(0.612913), + REAL(-0.126251), REAL(0.577170), REAL(0.483159), + REAL(-0.149594), REAL(0.611520), REAL(0.557731), + REAL(-0.163188), REAL(0.660791), REAL(0.491080), + REAL(-0.172482), REAL(0.663387), REAL(0.415416), + REAL(-0.160464), REAL(0.591710), REAL(0.370659), + REAL(-0.156445), REAL(0.536396), REAL(0.378302), + REAL(-0.136496), REAL(0.444358), REAL(0.425226), + REAL(-0.095564), REAL(0.373768), REAL(0.473659), + REAL(-0.104146), REAL(0.315912), REAL(0.498104), + REAL(-0.000496), REAL(0.384194), REAL(0.473817), + REAL(-0.000183), REAL(0.297770), REAL(0.401486), + REAL(-0.129042), REAL(0.270145), REAL(0.434495), + REAL(0.000100), REAL(0.272963), REAL(0.349138), + REAL(-0.113060), REAL(0.236984), REAL(0.385554), + REAL(0.007260), REAL(0.016311), REAL(-0.883396), + REAL(0.007865), REAL(0.122104), REAL(-0.956137), + REAL(-0.032842), REAL(0.115282), REAL(-0.953252), + REAL(-0.089115), REAL(0.108449), REAL(-0.950317), + REAL(-0.047440), REAL(0.014729), REAL(-0.882756), + REAL(-0.104458), REAL(0.013137), REAL(-0.882070), + REAL(-0.086439), REAL(-0.584866), REAL(-0.608343), + REAL(-0.115026), REAL(-0.662605), REAL(-0.436732), + REAL(-0.071683), REAL(-0.665372), REAL(-0.606385), + REAL(-0.257884), REAL(-0.665381), REAL(-0.658052), + REAL(-0.272542), REAL(-0.665381), REAL(-0.592063), + REAL(-0.371322), REAL(-0.665382), REAL(-0.353620), + REAL(-0.372362), REAL(-0.665381), REAL(-0.224420), + REAL(-0.335166), REAL(-0.665380), REAL(-0.078623), + REAL(-0.225999), REAL(-0.665375), REAL(-0.038981), + REAL(-0.106719), REAL(-0.665374), REAL(-0.186351), + REAL(-0.081749), REAL(-0.665372), REAL(-0.292554), + REAL(0.006943), REAL(-0.091505), REAL(-0.858354), + REAL(0.006117), REAL(-0.280985), REAL(-0.769967), + REAL(0.004495), REAL(-0.502360), REAL(-0.559799), + REAL(-0.198638), REAL(-0.302135), REAL(-0.845816), + REAL(-0.237395), REAL(-0.542544), REAL(-0.587188), + REAL(-0.270001), REAL(-0.279489), REAL(-0.669861), + REAL(-0.134547), REAL(-0.119852), REAL(-0.959004), + REAL(-0.052088), REAL(-0.122463), REAL(-0.944549), + REAL(-0.124463), REAL(-0.293508), REAL(-0.899566), + REAL(-0.047616), REAL(-0.289643), REAL(-0.879292), + REAL(-0.168595), REAL(-0.529132), REAL(-0.654931), + REAL(-0.099793), REAL(-0.515719), REAL(-0.645873), + REAL(-0.186168), REAL(-0.605282), REAL(-0.724690), + REAL(-0.112970), REAL(-0.583097), REAL(-0.707469), + REAL(-0.108152), REAL(-0.665375), REAL(-0.700408), + REAL(-0.183019), REAL(-0.665378), REAL(-0.717630), + REAL(-0.349529), REAL(-0.334459), REAL(-0.511985), + REAL(-0.141182), REAL(-0.437705), REAL(-0.798194), + REAL(-0.212670), REAL(-0.448725), REAL(-0.737447), + REAL(-0.261111), REAL(-0.414945), REAL(-0.613835), + REAL(-0.077364), REAL(-0.431480), REAL(-0.778113), + REAL(0.005174), REAL(-0.425277), REAL(-0.651592), + REAL(0.089236), REAL(-0.431732), REAL(-0.777093), + REAL(0.271006), REAL(-0.415749), REAL(-0.610577), + REAL(0.223981), REAL(-0.449384), REAL(-0.734774), + REAL(0.153275), REAL(-0.438150), REAL(-0.796391), + REAL(0.358414), REAL(-0.335529), REAL(-0.507649), + REAL(0.193434), REAL(-0.665946), REAL(-0.715325), + REAL(0.118363), REAL(-0.665717), REAL(-0.699021), + REAL(0.123515), REAL(-0.583454), REAL(-0.706020), + REAL(0.196851), REAL(-0.605860), REAL(-0.722345), + REAL(0.109788), REAL(-0.516035), REAL(-0.644590), + REAL(0.178656), REAL(-0.529656), REAL(-0.652804), + REAL(0.061157), REAL(-0.289807), REAL(-0.878626), + REAL(0.138234), REAL(-0.293905), REAL(-0.897958), + REAL(0.066933), REAL(-0.122643), REAL(-0.943820), + REAL(0.149571), REAL(-0.120281), REAL(-0.957264), + REAL(0.280989), REAL(-0.280321), REAL(-0.666487), + REAL(0.246581), REAL(-0.543275), REAL(-0.584224), + REAL(0.211720), REAL(-0.302754), REAL(-0.843303), + REAL(0.086966), REAL(-0.665627), REAL(-0.291520), + REAL(0.110634), REAL(-0.665702), REAL(-0.185021), + REAL(0.228099), REAL(-0.666061), REAL(-0.036201), + REAL(0.337743), REAL(-0.666396), REAL(-0.074503), + REAL(0.376722), REAL(-0.666513), REAL(-0.219833), + REAL(0.377265), REAL(-0.666513), REAL(-0.349036), + REAL(0.281411), REAL(-0.666217), REAL(-0.588670), + REAL(0.267564), REAL(-0.666174), REAL(-0.654834), + REAL(0.080745), REAL(-0.665602), REAL(-0.605452), + REAL(0.122016), REAL(-0.662963), REAL(-0.435280), + REAL(0.095767), REAL(-0.585141), REAL(-0.607228), + REAL(0.118944), REAL(0.012799), REAL(-0.880702), + REAL(0.061944), REAL(0.014564), REAL(-0.882086), + REAL(0.104725), REAL(0.108156), REAL(-0.949130), + REAL(0.048513), REAL(0.115159), REAL(-0.952753), + REAL(0.112696), REAL(0.236643), REAL(0.386937), + REAL(0.128177), REAL(0.269757), REAL(0.436071), + REAL(0.102643), REAL(0.315600), REAL(0.499370), + REAL(0.094535), REAL(0.373481), REAL(0.474824), + REAL(0.136270), REAL(0.443946), REAL(0.426895), + REAL(0.157071), REAL(0.535923), REAL(0.380222), + REAL(0.161350), REAL(0.591224), REAL(0.372630), + REAL(0.173035), REAL(0.662865), REAL(0.417531), + REAL(0.162808), REAL(0.660299), REAL(0.493077), + REAL(0.148250), REAL(0.611070), REAL(0.559555), + REAL(0.125719), REAL(0.576790), REAL(0.484702), + REAL(0.123489), REAL(0.534699), REAL(0.614440), + REAL(0.087621), REAL(0.506066), REAL(0.530188), + REAL(0.055321), REAL(0.442365), REAL(0.572915), + REAL(0.219936), REAL(0.568361), REAL(0.448571), + REAL(0.238099), REAL(0.441375), REAL(0.498528), + REAL(0.281711), REAL(0.414315), REAL(0.451121), + REAL(0.263833), REAL(0.528513), REAL(0.415794), + REAL(0.303284), REAL(0.533081), REAL(0.363998), + REAL(0.269687), REAL(0.623528), REAL(0.380528), + REAL(0.314255), REAL(0.670153), REAL(0.290524), + REAL(0.272023), REAL(0.682273), REAL(0.385343), + REAL(0.311480), REAL(0.775931), REAL(0.308527), + REAL(0.240239), REAL(0.652714), REAL(0.466159), + REAL(0.265619), REAL(0.756464), REAL(0.504187), + REAL(0.192562), REAL(0.467341), REAL(0.522972), + REAL(0.201605), REAL(0.524885), REAL(0.478417), + REAL(0.215743), REAL(0.564193), REAL(0.538084), + REAL(0.264969), REAL(0.641527), REAL(0.605317), + REAL(0.201031), REAL(0.477940), REAL(0.584002), + REAL(0.263086), REAL(0.512567), REAL(0.637832), + REAL(0.238615), REAL(0.526867), REAL(0.672237), + REAL(0.105309), REAL(0.455123), REAL(0.658482), + REAL(0.183993), REAL(0.102195), REAL(0.804872), + REAL(0.161563), REAL(0.060042), REAL(0.808692), + REAL(0.180748), REAL(0.077754), REAL(0.771600), + REAL(0.175168), REAL(0.128588), REAL(0.746368), + REAL(0.175075), REAL(0.148030), REAL(0.778264), + REAL(0.175658), REAL(0.139265), REAL(0.814333), + REAL(0.154191), REAL(0.067291), REAL(0.832578), + REAL(0.163818), REAL(0.109013), REAL(0.842830), + REAL(0.084760), REAL(0.396004), REAL(0.679695), + REAL(0.238888), REAL(0.310760), REAL(0.590775), + REAL(0.213380), REAL(0.308625), REAL(0.644905), + REAL(0.199666), REAL(0.409678), REAL(0.683003), + REAL(0.190143), REAL(0.128597), REAL(0.733463), + REAL(0.184833), REAL(0.063516), REAL(0.762902), + REAL(0.166070), REAL(0.035644), REAL(0.818261), + REAL(0.154361), REAL(0.056943), REAL(0.857042), + REAL(0.168542), REAL(0.109489), REAL(0.862725), + REAL(0.187387), REAL(0.166131), REAL(0.784599), + REAL(0.180428), REAL(0.160135), REAL(0.819438), + REAL(0.201823), REAL(0.163991), REAL(0.695756), + REAL(0.194206), REAL(0.206635), REAL(0.782275), + REAL(0.155438), REAL(0.291260), REAL(0.734412), + REAL(0.177696), REAL(0.196424), REAL(0.846693), + REAL(0.152305), REAL(0.125256), REAL(0.890786), + REAL(0.119546), REAL(0.249876), REAL(0.859104), + REAL(0.118369), REAL(0.139643), REAL(0.919173), + REAL(0.079410), REAL(0.132973), REAL(0.948652), + REAL(0.062419), REAL(0.036648), REAL(0.976547), + REAL(0.127847), REAL(-0.035919), REAL(0.947070), + REAL(0.143624), REAL(0.032206), REAL(0.885913), + REAL(0.074888), REAL(-0.085173), REAL(0.980577), + REAL(0.130184), REAL(-0.104656), REAL(0.947620), + REAL(0.156201), REAL(-0.094653), REAL(0.899074), + REAL(0.077366), REAL(-0.171194), REAL(0.926545), + REAL(0.127722), REAL(-0.164729), REAL(0.879810), + REAL(0.052670), REAL(-0.184618), REAL(0.842019), + REAL(0.023477), REAL(-0.184638), REAL(0.889811), + REAL(0.022626), REAL(-0.210587), REAL(0.827500), + REAL(0.223089), REAL(0.211976), REAL(0.620493), + REAL(0.251444), REAL(0.113067), REAL(0.666494), + REAL(0.251419), REAL(0.089540), REAL(0.673887), + REAL(0.214360), REAL(0.019258), REAL(0.771595), + REAL(0.158999), REAL(0.001490), REAL(0.835374), + REAL(0.176696), REAL(-0.059249), REAL(0.849218), + REAL(0.148696), REAL(-0.130091), REAL(0.793599), + REAL(0.108290), REAL(-0.166528), REAL(0.772088), + REAL(0.049820), REAL(-0.201382), REAL(0.764454), + REAL(0.071341), REAL(-0.215195), REAL(0.697209), + REAL(0.073148), REAL(-0.214475), REAL(0.623510), + REAL(0.140502), REAL(-0.169461), REAL(0.699354), + REAL(0.163374), REAL(-0.157073), REAL(0.611416), + REAL(0.189466), REAL(-0.138550), REAL(0.730366), + REAL(0.247593), REAL(-0.082554), REAL(0.759610), + REAL(0.227468), REAL(-0.121982), REAL(0.590197), + REAL(0.284702), REAL(-0.006586), REAL(0.535347), + REAL(0.275741), REAL(0.125287), REAL(0.446676), + REAL(0.266650), REAL(0.192594), REAL(0.506044), + REAL(0.300086), REAL(0.053287), REAL(0.629620), + REAL(0.055450), REAL(-0.663935), REAL(0.375065), + REAL(0.122854), REAL(-0.664138), REAL(0.482323), + REAL(0.046520), REAL(-0.531571), REAL(0.391918), + REAL(0.024824), REAL(-0.568450), REAL(0.275106), + REAL(0.053855), REAL(-0.663931), REAL(0.328224), + REAL(0.112829), REAL(-0.453549), REAL(0.305788), + REAL(0.131265), REAL(-0.510617), REAL(0.080746), + REAL(0.061174), REAL(-0.430716), REAL(-0.042710), + REAL(0.341019), REAL(-0.532887), REAL(-0.208150), + REAL(0.347705), REAL(-0.623533), REAL(-0.081139), + REAL(0.238040), REAL(-0.610732), REAL(-0.038037), + REAL(0.211764), REAL(-0.514274), REAL(-0.132078), + REAL(0.120605), REAL(-0.600219), REAL(-0.186856), + REAL(0.096985), REAL(-0.584476), REAL(-0.293357), + REAL(0.127621), REAL(-0.581941), REAL(-0.437170), + REAL(0.165902), REAL(-0.477425), REAL(-0.291453), + REAL(0.077720), REAL(-0.417975), REAL(-0.220519), + REAL(0.320892), REAL(-0.506363), REAL(-0.320874), + REAL(0.248214), REAL(-0.465684), REAL(-0.239842), + REAL(0.118764), REAL(-0.383338), REAL(-0.187114), + REAL(0.118816), REAL(-0.430106), REAL(-0.123307), + REAL(0.094131), REAL(-0.419464), REAL(-0.044777), + REAL(0.274526), REAL(-0.261706), REAL(0.005110), + REAL(0.259842), REAL(-0.283292), REAL(-0.003185), + REAL(0.222861), REAL(-0.340431), REAL(-0.038210), + REAL(0.204445), REAL(-0.664380), REAL(0.513353), + REAL(0.259286), REAL(-0.664547), REAL(0.471281), + REAL(0.185402), REAL(-0.476020), REAL(0.421718), + REAL(0.279163), REAL(-0.664604), REAL(0.417328), + REAL(0.277157), REAL(-0.528122), REAL(0.400208), + REAL(0.183069), REAL(-0.509812), REAL(0.329995), + REAL(0.282599), REAL(-0.429210), REAL(0.059242), + REAL(0.254816), REAL(-0.664541), REAL(0.290687), + REAL(0.271436), REAL(-0.567707), REAL(0.263966), + REAL(0.386561), REAL(-0.625221), REAL(-0.216870), + REAL(0.387086), REAL(-0.630883), REAL(-0.346073), + REAL(0.380021), REAL(-0.596021), REAL(-0.318679), + REAL(0.291269), REAL(-0.619007), REAL(-0.585707), + REAL(0.339280), REAL(-0.571198), REAL(-0.461946), + REAL(0.400045), REAL(-0.489778), REAL(-0.422640), + REAL(0.406817), REAL(-0.314349), REAL(-0.371230), + REAL(0.300588), REAL(-0.281718), REAL(-0.170549), + REAL(0.290866), REAL(-0.277304), REAL(-0.061905), + REAL(0.187735), REAL(-0.241545), REAL(0.509437), + REAL(0.188032), REAL(-0.287569), REAL(0.424234), + REAL(0.227520), REAL(-0.373262), REAL(0.293102), + REAL(0.266526), REAL(-0.273650), REAL(0.039597), + REAL(0.291592), REAL(-0.291676), REAL(0.111386), + REAL(0.291914), REAL(-0.122741), REAL(0.422683), + REAL(0.297574), REAL(-0.156119), REAL(0.373368), + REAL(0.286603), REAL(-0.232731), REAL(0.027162), + REAL(0.364663), REAL(-0.201399), REAL(0.206850), + REAL(0.353855), REAL(-0.132408), REAL(0.149228), + REAL(0.282208), REAL(-0.019715), REAL(0.314960), + REAL(0.331187), REAL(-0.099266), REAL(0.092701), + REAL(0.375463), REAL(-0.093120), REAL(-0.006467), + REAL(0.375917), REAL(-0.101236), REAL(-0.154882), + REAL(0.466635), REAL(-0.094416), REAL(-0.305669), + REAL(0.455805), REAL(-0.119881), REAL(-0.460632), + REAL(0.277465), REAL(-0.604242), REAL(-0.651871), + REAL(0.261022), REAL(-0.551176), REAL(-0.554667), + REAL(0.093627), REAL(0.258494), REAL(-0.920589), + REAL(0.114248), REAL(0.310608), REAL(-0.798070), + REAL(0.144232), REAL(0.211434), REAL(-0.835001), + REAL(0.119916), REAL(0.176940), REAL(-0.951159), + REAL(0.184061), REAL(0.101854), REAL(-0.918220), + REAL(0.092431), REAL(0.276521), REAL(-0.738231), + REAL(0.133504), REAL(0.218403), REAL(-0.758602), + REAL(0.194987), REAL(0.097655), REAL(-0.812476), + REAL(0.185542), REAL(0.011005), REAL(-0.879202), + REAL(0.230315), REAL(-0.127450), REAL(-0.884202), + REAL(0.260471), REAL(0.255056), REAL(-0.624378), + REAL(0.351567), REAL(-0.042194), REAL(-0.663976), + REAL(0.253742), REAL(0.323524), REAL(-0.433716), + REAL(0.411612), REAL(0.132299), REAL(-0.438264), + REAL(0.270513), REAL(0.356530), REAL(-0.289984), + REAL(0.422146), REAL(0.162819), REAL(-0.273130), + REAL(0.164724), REAL(0.237490), REAL(0.208912), + REAL(0.253806), REAL(0.092900), REAL(0.240640), + REAL(0.203608), REAL(0.284597), REAL(0.096223), + REAL(0.241006), REAL(0.343093), REAL(-0.171396), + REAL(0.356076), REAL(0.149288), REAL(-0.143443), + REAL(0.337656), REAL(0.131992), REAL(0.066374) +}; + +int gIndicesBunny[BUNNY_NUM_TRIANGLES][3] = { + {126,134,133}, + {342,138,134}, + {133,134,138}, + {126,342,134}, + {312,316,317}, + {169,163,162}, + {312,317,319}, + {312,319,318}, + {169,162,164}, + {169,168,163}, + {312,314,315}, + {169,164,165}, + {169,167,168}, + {312,315,316}, + {312,313,314}, + {169,165,166}, + {169,166,167}, + {312,318,313}, + {308,304,305}, + {308,305,306}, + {179,181,188}, + {177,173,175}, + {177,175,176}, + {302,293,300}, + {322,294,304}, + {188,176,175}, + {188,175,179}, + {158,177,187}, + {305,293,302}, + {305,302,306}, + {322,304,308}, + {188,181,183}, + {158,173,177}, + {293,298,300}, + {304,294,296}, + {304,296,305}, + {185,176,188}, + {185,188,183}, + {187,177,176}, + {187,176,185}, + {305,296,298}, + {305,298,293}, + {436,432, 28}, + {436, 28, 23}, + {434,278,431}, + { 30,208,209}, + { 30,209, 29}, + { 19, 20, 24}, + {208,207,211}, + {208,211,209}, + { 19,210,212}, + {433,434,431}, + {433,431,432}, + {433,432,436}, + {436,437,433}, + {277,275,276}, + {277,276,278}, + {209,210, 25}, + { 21, 26, 24}, + { 21, 24, 20}, + { 25, 26, 27}, + { 25, 27, 29}, + {435,439,277}, + {439,275,277}, + {432,431, 30}, + {432, 30, 28}, + {433,437,438}, + {433,438,435}, + {434,277,278}, + { 24, 25,210}, + { 24, 26, 25}, + { 29, 27, 28}, + { 29, 28, 30}, + { 19, 24,210}, + {208, 30,431}, + {208,431,278}, + {435,434,433}, + {435,277,434}, + { 25, 29,209}, + { 27, 22, 23}, + { 27, 23, 28}, + { 26, 22, 27}, + { 26, 21, 22}, + {212,210,209}, + {212,209,211}, + {207,208,278}, + {207,278,276}, + {439,435,438}, + { 12, 9, 10}, + { 12, 10, 13}, + { 2, 3, 5}, + { 2, 5, 4}, + { 16, 13, 14}, + { 16, 14, 17}, + { 22, 21, 16}, + { 13, 10, 11}, + { 13, 11, 14}, + { 1, 0, 3}, + { 1, 3, 2}, + { 15, 12, 16}, + { 19, 18, 15}, + { 19, 15, 16}, + { 19, 16, 20}, + { 9, 1, 2}, + { 9, 2, 10}, + { 3, 7, 8}, + { 3, 8, 5}, + { 16, 17, 23}, + { 16, 23, 22}, + { 21, 20, 16}, + { 10, 2, 4}, + { 10, 4, 11}, + { 0, 6, 7}, + { 0, 7, 3}, + { 12, 13, 16}, + {451,446,445}, + {451,445,450}, + {442,440,439}, + {442,439,438}, + {442,438,441}, + {421,420,422}, + {412,411,426}, + {412,426,425}, + {408,405,407}, + {413, 67, 68}, + {413, 68,414}, + {391,390,412}, + { 80,384,386}, + {404,406,378}, + {390,391,377}, + {390,377, 88}, + {400,415,375}, + {398,396,395}, + {398,395,371}, + {398,371,370}, + {112,359,358}, + {112,358,113}, + {351,352,369}, + {125,349,348}, + {345,343,342}, + {342,340,339}, + {341,335,337}, + {328,341,327}, + {331,323,333}, + {331,322,323}, + {327,318,319}, + {327,319,328}, + {315,314,324}, + {302,300,301}, + {302,301,303}, + {320,311,292}, + {285,284,289}, + {310,307,288}, + {310,288,290}, + {321,350,281}, + {321,281,282}, + {423,448,367}, + {272,273,384}, + {272,384,274}, + {264,265,382}, + {264,382,383}, + {440,442,261}, + {440,261,263}, + {252,253,254}, + {252,254,251}, + {262,256,249}, + {262,249,248}, + {228,243,242}, + {228, 31,243}, + {213,215,238}, + {213,238,237}, + { 19,212,230}, + {224,225,233}, + {224,233,231}, + {217,218, 56}, + {217, 56, 54}, + {217,216,239}, + {217,239,238}, + {217,238,215}, + {218,217,215}, + {218,215,214}, + { 6,102,206}, + {186,199,200}, + {197,182,180}, + {170,171,157}, + {201,200,189}, + {170,190,191}, + {170,191,192}, + {175,174,178}, + {175,178,179}, + {168,167,155}, + {122,149,158}, + {122,158,159}, + {135,153,154}, + {135,154,118}, + {143,140,141}, + {143,141,144}, + {132,133,136}, + {130,126,133}, + {124,125,127}, + {122,101,100}, + {122,100,121}, + {110,108,107}, + {110,107,109}, + { 98, 99, 97}, + { 98, 97, 64}, + { 98, 64, 66}, + { 87, 55, 57}, + { 83, 82, 79}, + { 83, 79, 84}, + { 78, 74, 50}, + { 49, 71, 41}, + { 49, 41, 37}, + { 49, 37, 36}, + { 58, 44, 60}, + { 60, 59, 58}, + { 51, 34, 33}, + { 39, 40, 42}, + { 39, 42, 38}, + {243,240, 33}, + {243, 33,229}, + { 39, 38, 6}, + { 44, 46, 40}, + { 55, 56, 57}, + { 64, 62, 65}, + { 64, 65, 66}, + { 41, 71, 45}, + { 75, 50, 51}, + { 81, 79, 82}, + { 77, 88, 73}, + { 93, 92, 94}, + { 68, 47, 46}, + { 96, 97, 99}, + { 96, 99, 95}, + {110,109,111}, + {111,112,110}, + {114,113,123}, + {114,123,124}, + {132,131,129}, + {133,137,136}, + {135,142,145}, + {145,152,135}, + {149,147,157}, + {157,158,149}, + {164,150,151}, + {153,163,168}, + {153,168,154}, + {185,183,182}, + {185,182,184}, + {161,189,190}, + {200,199,191}, + {200,191,190}, + {180,178,195}, + {180,195,196}, + {102,101,204}, + {102,204,206}, + { 43, 48,104}, + { 43,104,103}, + {216,217, 54}, + {216, 54, 32}, + {207,224,231}, + {230,212,211}, + {230,211,231}, + {227,232,241}, + {227,241,242}, + {235,234,241}, + {235,241,244}, + {430,248,247}, + {272,274,253}, + {272,253,252}, + {439,260,275}, + {225,224,259}, + {225,259,257}, + {269,270,407}, + {269,407,405}, + {270,269,273}, + {270,273,272}, + {273,269,268}, + {273,268,267}, + {273,267,266}, + {273,266,265}, + {273,265,264}, + {448,279,367}, + {281,350,368}, + {285,286,301}, + {290,323,310}, + {290,311,323}, + {282,281,189}, + {292,311,290}, + {292,290,291}, + {307,306,302}, + {307,302,303}, + {316,315,324}, + {316,324,329}, + {331,351,350}, + {330,334,335}, + {330,335,328}, + {341,337,338}, + {344,355,354}, + {346,345,348}, + {346,348,347}, + {364,369,352}, + {364,352,353}, + {365,363,361}, + {365,361,362}, + {376,401,402}, + {373,372,397}, + {373,397,400}, + {376, 92,377}, + {381,378,387}, + {381,387,385}, + {386, 77, 80}, + {390,389,412}, + {416,417,401}, + {403,417,415}, + {408,429,430}, + {419,423,418}, + {427,428,444}, + {427,444,446}, + {437,436,441}, + {450,445, 11}, + {450, 11, 4}, + {447,449, 5}, + {447, 5, 8}, + {441,438,437}, + {425,426,451}, + {425,451,452}, + {417,421,415}, + {408,407,429}, + {399,403,400}, + {399,400,397}, + {394,393,416}, + {389,411,412}, + {386,383,385}, + {408,387,378}, + {408,378,406}, + {377,391,376}, + { 94,375,415}, + {372,373,374}, + {372,374,370}, + {359,111,360}, + {359,112,111}, + {113,358,349}, + {113,349,123}, + {346,343,345}, + {343,340,342}, + {338,336,144}, + {338,144,141}, + {327,341,354}, + {327,354,326}, + {331,350,321}, + {331,321,322}, + {314,313,326}, + {314,326,325}, + {300,298,299}, + {300,299,301}, + {288,287,289}, + {189,292,282}, + {287,288,303}, + {284,285,297}, + {368,280,281}, + {448,447,279}, + {274,226,255}, + {267,268,404}, + {267,404,379}, + {429,262,430}, + {439,440,260}, + {257,258,249}, + {257,249,246}, + {430,262,248}, + {234,228,242}, + {234,242,241}, + {237,238,239}, + {237,239,236}, + { 15, 18,227}, + { 15,227,229}, + {222,223, 82}, + {222, 82, 83}, + {214,215,213}, + {214,213, 81}, + { 38,102, 6}, + {122,159,200}, + {122,200,201}, + {174,171,192}, + {174,192,194}, + {197,193,198}, + {190,170,161}, + {181,179,178}, + {181,178,180}, + {166,156,155}, + {163,153,152}, + {163,152,162}, + {120,156,149}, + {120,149,121}, + {152,153,135}, + {140,143,142}, + {135,131,132}, + {135,132,136}, + {130,129,128}, + {130,128,127}, + {100,105,119}, + {100,119,120}, + {106,104,107}, + {106,107,108}, + { 91, 95, 59}, + { 93, 94, 68}, + { 91, 89, 92}, + { 76, 53, 55}, + { 76, 55, 87}, + { 81, 78, 79}, + { 74, 73, 49}, + { 69, 60, 45}, + { 58, 62, 64}, + { 58, 64, 61}, + { 53, 31, 32}, + { 32, 54, 53}, + { 42, 43, 38}, + { 35, 36, 0}, + { 35, 0, 1}, + { 34, 35, 1}, + { 34, 1, 9}, + { 44, 40, 41}, + { 44, 41, 45}, + { 33,240, 51}, + { 63, 62, 58}, + { 63, 58, 59}, + { 45, 71, 70}, + { 76, 75, 51}, + { 76, 51, 52}, + { 86, 85, 84}, + { 86, 84, 87}, + { 89, 72, 73}, + { 89, 73, 88}, + { 91, 92, 96}, + { 91, 96, 95}, + { 72, 91, 60}, + { 72, 60, 69}, + {104,106,105}, + {119,105,117}, + {119,117,118}, + {124,127,128}, + {117,116,129}, + {117,129,131}, + {118,117,131}, + {135,140,142}, + {146,150,152}, + {146,152,145}, + {149,122,121}, + {166,165,151}, + {166,151,156}, + {158,172,173}, + {161,160,189}, + {199,198,193}, + {199,193,191}, + {204,201,202}, + {178,174,194}, + {200,159,186}, + {109, 48, 67}, + { 48,107,104}, + {216, 32,236}, + {216,236,239}, + {223,214, 81}, + {223, 81, 82}, + { 33, 12, 15}, + { 32,228,234}, + { 32,234,236}, + {240, 31, 52}, + {256,255,246}, + {256,246,249}, + {258,263,248}, + {258,248,249}, + {275,260,259}, + {275,259,276}, + {207,276,259}, + {270,271,429}, + {270,429,407}, + {413,418,366}, + {413,366,365}, + {368,367,279}, + {368,279,280}, + {303,301,286}, + {303,286,287}, + {283,282,292}, + {283,292,291}, + {320,292,189}, + {298,296,297}, + {298,297,299}, + {318,327,326}, + {318,326,313}, + {329,330,317}, + {336,333,320}, + {326,354,353}, + {334,332,333}, + {334,333,336}, + {342,339,139}, + {342,139,138}, + {345,342,126}, + {347,357,356}, + {369,368,351}, + {363,356,357}, + {363,357,361}, + {366,367,368}, + {366,368,369}, + {375,373,400}, + { 92, 90,377}, + {409,387,408}, + {386,385,387}, + {386,387,388}, + {412,394,391}, + {396,398,399}, + {408,406,405}, + {415,421,419}, + {415,419,414}, + {425,452,448}, + {425,448,424}, + {444,441,443}, + {448,452,449}, + {448,449,447}, + {446,444,443}, + {446,443,445}, + {250,247,261}, + {250,261,428}, + {421,422,423}, + {421,423,419}, + {427,410,250}, + {417,403,401}, + {403,402,401}, + {420,392,412}, + {420,412,425}, + {420,425,424}, + {386,411,389}, + {383,382,381}, + {383,381,385}, + {378,379,404}, + {372,371,395}, + {372,395,397}, + {371,372,370}, + {361,359,360}, + {361,360,362}, + {368,350,351}, + {349,347,348}, + {356,355,344}, + {356,344,346}, + {344,341,340}, + {344,340,343}, + {338,337,336}, + {328,335,341}, + {324,352,351}, + {324,351,331}, + {320,144,336}, + {314,325,324}, + {322,308,309}, + {310,309,307}, + {287,286,289}, + {203,280,279}, + {203,279,205}, + {297,295,283}, + {297,283,284}, + {447,205,279}, + {274,384, 80}, + {274, 80,226}, + {266,267,379}, + {266,379,380}, + {225,257,246}, + {225,246,245}, + {256,254,253}, + {256,253,255}, + {430,247,250}, + {226,235,244}, + {226,244,245}, + {232,233,244}, + {232,244,241}, + {230, 18, 19}, + { 32, 31,228}, + {219,220, 86}, + {219, 86, 57}, + {226,213,235}, + {206, 7, 6}, + {122,201,101}, + {201,204,101}, + {180,196,197}, + {170,192,171}, + {200,190,189}, + {194,193,195}, + {183,181,180}, + {183,180,182}, + {155,154,168}, + {149,156,151}, + {149,151,148}, + {155,156,120}, + {145,142,143}, + {145,143,146}, + {136,137,140}, + {133,132,130}, + {128,129,116}, + {100,120,121}, + {110,112,113}, + {110,113,114}, + { 66, 65, 63}, + { 66, 63, 99}, + { 66, 99, 98}, + { 96, 46, 61}, + { 89, 88, 90}, + { 86, 87, 57}, + { 80, 78, 81}, + { 72, 69, 49}, + { 67, 48, 47}, + { 67, 47, 68}, + { 56, 55, 53}, + { 50, 49, 36}, + { 50, 36, 35}, + { 40, 39, 41}, + {242,243,229}, + {242,229,227}, + { 6, 37, 39}, + { 42, 47, 48}, + { 42, 48, 43}, + { 61, 46, 44}, + { 45, 70, 69}, + { 69, 70, 71}, + { 69, 71, 49}, + { 74, 78, 77}, + { 83, 84, 85}, + { 73, 74, 77}, + { 93, 96, 92}, + { 68, 46, 93}, + { 95, 99, 63}, + { 95, 63, 59}, + {115,108,110}, + {115,110,114}, + {125,126,127}, + {129,130,132}, + {137,133,138}, + {137,138,139}, + {148,146,143}, + {148,143,147}, + {119,118,154}, + {161,147,143}, + {165,164,151}, + {158,157,171}, + {158,171,172}, + {159,158,187}, + {159,187,186}, + {194,192,191}, + {194,191,193}, + {189,202,201}, + {182,197,184}, + {205, 8, 7}, + { 48,109,107}, + {218,219, 57}, + {218, 57, 56}, + {207,231,211}, + {232,230,231}, + {232,231,233}, + { 53, 52, 31}, + {388,411,386}, + {409,430,250}, + {262,429,254}, + {262,254,256}, + {442,444,428}, + {273,264,383}, + {273,383,384}, + {429,271,251}, + {429,251,254}, + {413,365,362}, + { 67,413,360}, + {282,283,295}, + {285,301,299}, + {202,281,280}, + {284,283,291}, + {284,291,289}, + {320,189,160}, + {308,306,307}, + {307,309,308}, + {319,317,330}, + {319,330,328}, + {353,352,324}, + {332,331,333}, + {340,341,338}, + {354,341,344}, + {349,358,357}, + {349,357,347}, + {364,355,356}, + {364,356,363}, + {364,365,366}, + {364,366,369}, + {374,376,402}, + {375, 92,373}, + { 77,389,390}, + {382,380,381}, + {389, 77,386}, + {393,394,412}, + {393,412,392}, + {401,394,416}, + {415,400,403}, + {411,410,427}, + {411,427,426}, + {422,420,424}, + {247,248,263}, + {247,263,261}, + {445,443, 14}, + {445, 14, 11}, + {449,450, 4}, + {449, 4, 5}, + {443,441, 17}, + {443, 17, 14}, + {436, 23, 17}, + {436, 17,441}, + {424,448,422}, + {448,423,422}, + {414,419,418}, + {414,418,413}, + {406,404,405}, + {399,397,395}, + {399,395,396}, + {420,416,392}, + {388,410,411}, + {386,384,383}, + {390, 88, 77}, + {375, 94, 92}, + {415,414, 68}, + {415, 68, 94}, + {370,374,402}, + {370,402,398}, + {361,357,358}, + {361,358,359}, + {125,348,126}, + {346,344,343}, + {340,338,339}, + {337,335,334}, + {337,334,336}, + {325,353,324}, + {324,331,332}, + {324,332,329}, + {323,322,309}, + {323,309,310}, + {294,295,297}, + {294,297,296}, + {289,286,285}, + {202,280,203}, + {288,307,303}, + {282,295,321}, + { 67,360,111}, + {418,423,367}, + {418,367,366}, + {272,252,251}, + {272,251,271}, + {272,271,270}, + {255,253,274}, + {265,266,380}, + {265,380,382}, + {442,428,261}, + {440,263,258}, + {440,258,260}, + {409,250,410}, + {255,226,245}, + {255,245,246}, + { 31,240,243}, + {236,234,235}, + {236,235,237}, + {233,225,245}, + {233,245,244}, + {220,221, 85}, + {220, 85, 86}, + { 81,213,226}, + { 81,226, 80}, + { 7,206,205}, + {186,184,198}, + {186,198,199}, + {204,203,205}, + {204,205,206}, + {195,193,196}, + {171,174,172}, + {173,174,175}, + {173,172,174}, + {155,167,166}, + {160,161,143}, + {160,143,144}, + {119,154,155}, + {148,151,150}, + {148,150,146}, + {140,137,139}, + {140,139,141}, + {127,126,130}, + {114,124,128}, + {114,128,115}, + {117,105,106}, + {117,106,116}, + {104,105,100}, + {104,100,103}, + { 59, 60, 91}, + { 97, 96, 61}, + { 97, 61, 64}, + { 91, 72, 89}, + { 87, 84, 79}, + { 87, 79, 76}, + { 78, 80, 77}, + { 49, 50, 74}, + { 60, 44, 45}, + { 61, 44, 58}, + { 51, 50, 35}, + { 51, 35, 34}, + { 39, 37, 41}, + { 33, 34, 9}, + { 33, 9, 12}, + { 0, 36, 37}, + { 0, 37, 6}, + { 40, 46, 47}, + { 40, 47, 42}, + { 53, 54, 56}, + { 65, 62, 63}, + { 72, 49, 73}, + { 79, 78, 75}, + { 79, 75, 76}, + { 52, 53, 76}, + { 92, 89, 90}, + { 96, 93, 46}, + {102,103,100}, + {102,100,101}, + {116,106,108}, + {116,108,115}, + {123,125,124}, + {116,115,128}, + {118,131,135}, + {140,135,136}, + {148,147,149}, + {120,119,155}, + {164,162,152}, + {164,152,150}, + {157,147,161}, + {157,161,170}, + {186,187,185}, + {186,185,184}, + {193,197,196}, + {202,203,204}, + {194,195,178}, + {198,184,197}, + { 67,111,109}, + { 38, 43,103}, + { 38,103,102}, + {214,223,222}, + {214,222,221}, + {214,221,220}, + {214,220,219}, + {214,219,218}, + {213,237,235}, + {221,222, 83}, + {221, 83, 85}, + { 15,229, 33}, + {227, 18,230}, + {227,230,232}, + { 52, 51,240}, + { 75, 78, 50}, + {408,430,409}, + {260,258,257}, + {260,257,259}, + {224,207,259}, + {268,269,405}, + {268,405,404}, + {413,362,360}, + {447, 8,205}, + {299,297,285}, + {189,281,202}, + {290,288,289}, + {290,289,291}, + {322,321,295}, + {322,295,294}, + {333,323,311}, + {333,311,320}, + {317,316,329}, + {320,160,144}, + {353,325,326}, + {329,332,334}, + {329,334,330}, + {339,338,141}, + {339,141,139}, + {348,345,126}, + {347,356,346}, + {123,349,125}, + {364,353,354}, + {364,354,355}, + {365,364,363}, + {376,391,394}, + {376,394,401}, + { 92,376,374}, + { 92,374,373}, + {377, 90, 88}, + {380,379,378}, + {380,378,381}, + {388,387,409}, + {388,409,410}, + {416,393,392}, + {399,398,402}, + {399,402,403}, + {250,428,427}, + {421,417,416}, + {421,416,420}, + {426,427,446}, + {426,446,451}, + {444,442,441}, + {452,451,450}, + {452,450,449} +}; + + +//***************************THE END OF FAMOUS BUNNY TRIMESH********************************************// + + +#endif //BUNNY_MESH_H_ \ No newline at end of file diff --git a/Demos/GimpactTestDemo/GimpactTestDemo.cpp b/Demos/GimpactTestDemo/GimpactTestDemo.cpp new file mode 100644 index 000000000..b64af1a79 --- /dev/null +++ b/Demos/GimpactTestDemo/GimpactTestDemo.cpp @@ -0,0 +1,730 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "btBulletDynamicsCommon.h" +#include "GimpactTestDemo.h" + +#include "LinearMath/btDefaultMotionState.h" +#include "LinearMath/btIDebugDraw.h" +#include "LinearMath/btQuickprof.h" +#include "LinearMath/btDefaultMotionState.h" + +/// Including GIMPACT here +#include "GIMPACT/Bullet/btGImpactShape.h" +#include "GIMPACT/Bullet/btGImpactCollisionAlgorithm.h" + +#include "BMF_Api.h" + +#include "GLDebugDrawer.h" + +#include "GL_ShapeDrawer.h" +#include "GlutStuff.h" + +/// Include Torus Mesh here +#include "TorusMesh.h" +#include "BunnyMesh.h" + +GLDebugDrawer debugDrawer; +//Real dts = 0.000001f; +Real dts = 1.0 / 60.0; + + +///************************************************************************************** +/// GIMPACT Test Demo made by DevO +/// +///************************************************************************************** + +#define TEST_GIMPACT_TORUS + +//------------------------------------------------------------------------------ +///User can override this material combiner by implementing gContactAddedCallback and setting body0->m_collisionFlags |= btCollisionObject::customMaterialCallback; +inline btScalar calculateCombinedFriction(float friction0,float friction1) +{ + btScalar friction = friction0 * friction1; + + const btScalar MAX_FRICTION = 10.f; + if (friction < -MAX_FRICTION) + friction = -MAX_FRICTION; + if (friction > MAX_FRICTION) + friction = MAX_FRICTION; + return friction; + +} + +//------------------------------------------------------------------------------ +inline btScalar calculateCombinedRestitution(float restitution0,float restitution1) +{ + return restitution0 * restitution1; +} + + +//------------------------------------------------------------------------------ +bool CustomMaterialCombinerCallback(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1) +{ + + float friction0 = colObj0->getFriction(); + float friction1 = colObj1->getFriction(); + float restitution0 = colObj0->getRestitution(); + float restitution1 = colObj1->getRestitution(); + + if (colObj0->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK) + { + friction0 = 1.0;//partId0,index0 + restitution0 = 0.f; + } + if (colObj1->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK) + { + if (index1&1) + { + friction1 = 1.0f;//partId1,index1 + } else + { + friction1 = 0.f; + } + restitution1 = 0.f; + } + + cp.m_combinedFriction = calculateCombinedFriction(friction0,friction1); + cp.m_combinedRestitution = calculateCombinedRestitution(restitution0,restitution1); + + //this return value is currently ignored, but to be on the safe side: return false if you don't calculate friction + return true; +} + +extern ContactAddedCallback gContactAddedCallback; + + + +//################################## main ##################################### +int main(int argc,char** argv) +{ + gContactAddedCallback = CustomMaterialCombinerCallback; + + GimpactConcaveDemo* concaveDemo = new GimpactConcaveDemo(); /// This will not be Deleted!!! + concaveDemo->initPhysics(); + concaveDemo->setCameraDistance(45.f); + +//cannot run stepFront yet, the OpenGL context is not opened (stepFront updates camera...) +// concaveDemo->stepFront(); +// concaveDemo->stepFront(); +// concaveDemo->stepFront(); +// concaveDemo->stepFront(); + + return glutmain(argc, argv,640,480,"DevO,s GIMPACT Test Demo",concaveDemo); +} + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::renderme() +{ + updateCamera(); + + + btScalar m[16]; + + if (m_dynamicsWorld) + { + int numObjects = m_dynamicsWorld->getNumCollisionObjects(); + btVector3 wireColor(1,0,0); + for (int i=0;igetCollisionObjectArray()[i]; + btRigidBody* body = btRigidBody::upcast(colObj); + + if (body && body->getMotionState()) + { + btDefaultMotionState* myMotionState = (btDefaultMotionState*)body->getMotionState(); + myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(m); + } else + { + colObj->getWorldTransform().getOpenGLMatrix(m); + } + + btVector3 wireColor(1.f,1.0f,0.5f); //wants deactivation + if (i & 1) + { + wireColor = btVector3(0.f,0.0f,1.f); + } + ///color differently for active, sleeping, wantsdeactivation states + if (colObj->getActivationState() == 1) //active + { + if (i & 1) + { + wireColor += btVector3 (0.8f,0.1f,0.1f); + } else + { + wireColor += btVector3 (0.5f,0.f,0.f); + } + } + if (colObj->getActivationState() == 2) //ISLAND_SLEEPING + { + if (i & 1) + { + wireColor += btVector3 (0.5f,0.8f, 0.5f); + } else + { + wireColor += btVector3 (0.f,0.5f,0.f); + } + } + + GL_ShapeDrawer::drawOpenGL(m,colObj->getCollisionShape(),wireColor,getDebugMode()); + } + + + float xOffset = 10.f; + float yStart = 20.f; + float yIncr = 20.f; + char buf[124]; + + glColor3f(0, 0, 0); + + setOrthographicProjection(); + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"mouse to interact"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + /* glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"space to reset"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + */ + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"cursor keys and z,x to navigate"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"i to toggle simulation, s single step"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"q to quit"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,". to shoot TRIMESH (dot)"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + // not yet hooked up again after refactoring... + +/* glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"d to toggle deactivation"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; +*/ + + /* + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"a to draw temporal AABBs"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + */ + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"h to toggle help text"); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + //bool useBulletLCP = !(getDebugMode() & btIDebugDraw::DBG_DisableBulletLCP); + + bool useCCD = (getDebugMode() & btIDebugDraw::DBG_EnableCCD); + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"1 CCD mode (adhoc) = %i",useCCD); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + glRasterPos3f(xOffset,yStart,0); + sprintf(buf,"+- shooting speed = %10.2f",m_ShootBoxInitialSpeed); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); + yStart += yIncr; + + resetPerspectiveProjection(); + + + } + +} + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::initGImpactCollision() +{ + /// Create Torus Shape + { + m_indexVertexArrays = new btTriangleIndexVertexArray + (NUM_TRIANGLES, + &gIndices[0][0], + 3*sizeof(int), + NUM_VERTICES, + (Real*) &gVertices[0],sizeof(Real)*3); + + btGImpactMeshShape * trimesh = new btGImpactMeshShape(m_indexVertexArrays); + trimesh->setLocalScaling(btVector3(1.f,1.f,1.f)); + trimesh->updateBound(); + trimesh->setMargin(0.01); ///????? + m_trimeshShape = trimesh; + } + + /// Create Bunny Shape + { + m_indexVertexArrays2 = new btTriangleIndexVertexArray + (BUNNY_NUM_TRIANGLES, + &gIndicesBunny[0][0], + 3*sizeof(int), + BUNNY_NUM_VERTICES, + (Real*) &gVerticesBunny[0],sizeof(Real)*3); + + btGImpactMeshShape * trimesh2 = new btGImpactMeshShape(m_indexVertexArrays2); + trimesh2->setLocalScaling(btVector3(4.f,4.f,4.f)); + trimesh2->updateBound(); + trimesh2->setMargin(0.01); ///????? + m_trimeshShape2 = trimesh2; + } + + + ///register GIMPACT algorithm + btCollisionDispatcher * dispatcher = static_cast(m_dynamicsWorld ->getDispatcher()); + { + //btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher); /// Register GIMPACT !!! + if(!m_gimpactCollisionCreateFunc) m_gimpactCollisionCreateFunc = new btGImpactCollisionAlgorithm::CreateFunc; /// NEW + + for (GUINT i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ ) + { + m_dispatcher->registerCollisionCreateFunc(GIMPACT_SHAPE_PROXYTYPE,i ,m_gimpactCollisionCreateFunc); + } + for (GUINT i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ ) + { + m_dispatcher->registerCollisionCreateFunc(i,GIMPACT_SHAPE_PROXYTYPE ,m_gimpactCollisionCreateFunc); + } + } +} + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::initPhysics() +{ + /// Init Bullet + m_collisionConfiguration = new btDefaultCollisionConfiguration(); + + m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration); + //btOverlappingPairCache* broadphase = new btSimpleBroadphase(); + //m_broadphase = new btSimpleBroadphase(); + + LONG maxProxies = 1024; + btVector3 worldAabbMin(-10000,-10000,-10000); + btVector3 worldAabbMax( 10000, 10000, 10000); + m_broadphase = new bt32BitAxisSweep3(worldAabbMin,worldAabbMax,maxProxies); + + m_constraintSolver = new btSequentialImpulseConstraintSolver(); + + m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_constraintSolver); + m_dynamicsWorld->setDebugDrawer(&debugDrawer); + + //create trimesh model and shape + initGImpactCollision(); + + + + + /// Create Scene + float mass = 0.f; + btTransform startTransform; + startTransform.setIdentity(); + + btCollisionShape* staticboxShape1 = new btBoxShape(btVector3(200,1,200));//floor + btCollisionShape* staticboxShape2 = new btBoxShape(btVector3(1,50,200));//left wall + btCollisionShape* staticboxShape3 = new btBoxShape(btVector3(1,50,200));//right wall + btCollisionShape* staticboxShape4 = new btBoxShape(btVector3(200,50,1));//front wall + btCollisionShape* staticboxShape5 = new btBoxShape(btVector3(200,50,1));//back wall + + btCompoundShape* staticScenario = new btCompoundShape();//static scenario + + startTransform.setOrigin(btVector3(0,-10,0)); + staticScenario->addChildShape(startTransform,staticboxShape1); + startTransform.setOrigin(btVector3(-200,15,0)); + staticScenario->addChildShape(startTransform,staticboxShape2); + startTransform.setOrigin(btVector3(200,15,0)); + staticScenario->addChildShape(startTransform,staticboxShape3); + startTransform.setOrigin(btVector3(0,15,200)); + staticScenario->addChildShape(startTransform,staticboxShape4); + startTransform.setOrigin(btVector3(0,15,-200)); + staticScenario->addChildShape(startTransform,staticboxShape5); + + startTransform.setOrigin(btVector3(0,-10,0)); + + btRigidBody* staticBody = localCreateRigidBody(mass, startTransform,staticScenario); + + staticBody->setCollisionFlags(staticBody->getCollisionFlags()|btCollisionObject::CF_STATIC_OBJECT); + staticBody->setActivationState(ISLAND_SLEEPING); + + //enable custom material callback + staticBody->setCollisionFlags(staticBody->getCollisionFlags()|btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK); + + + //static plane + /* + btVector3 normal(0.4,1.5,-0.4); + normal.normalize(); + btCollisionShape* staticplaneShape6 = new btStaticPlaneShape(normal,0.0);// A plane + + startTransform.setOrigin(btVector3(0,-20,0)); + + btRigidBody* staticBody2 = localCreateRigidBody(mass, startTransform,staticplaneShape6 ); + + staticBody2->setCollisionFlags(staticBody2->getCollisionFlags()|btCollisionObject::CF_STATIC_OBJECT); + staticBody2->setActivationState(ISLAND_SLEEPING); + */ + + + /// Create Static Torus + float height = 32; + float step = 2.5; + float massT = 1.0; + + startTransform.setOrigin(btVector3(0,height,-5)); + startTransform.setRotation(btQuaternion(3.14159265*0.5,0,3.14159265*0.5)); + kinematicTorus = localCreateRigidBody(0.0, startTransform,m_trimeshShape); + //kinematicTorus->setCollisionFlags(kinematicTorus->getCollisionFlags()|btCollisionObject::CF_STATIC_OBJECT); + //kinematicTorus->setActivationState(ISLAND_SLEEPING); + + kinematicTorus->setCollisionFlags( kinematicTorus->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + kinematicTorus->setActivationState(DISABLE_DEACTIVATION); + + /// Kinematic + kinTorusTran = btVector3(-0.1,0,0); + kinTorusRot = btQuaternion(0,3.14159265*0.01,0); + +#ifdef TEST_GIMPACT_TORUS + + /// Create dynamic Torus + for (int i=0;i<8;i++) + { + height -= step; + startTransform.setOrigin(btVector3(0,height,-5)); + startTransform.setRotation(btQuaternion(0,0,3.14159265*0.5)); + btRigidBody* bodyA = localCreateRigidBody(massT, startTransform,m_trimeshShape); + + height -= step; + startTransform.setOrigin(btVector3(0,height,-5)); + startTransform.setRotation(btQuaternion(3.14159265*0.5,0,3.14159265*0.5)); + btRigidBody* bodyB = localCreateRigidBody(massT, startTransform,m_trimeshShape); + + } +#endif + + startTransform.setIdentity(); + + + /// Create Dynamic Boxes + { + for (int i=0;i<9;i++) + { + btCollisionShape* boxShape = new btBoxShape(btVector3(1,1,1)); + startTransform.setOrigin(btVector3(2*i-5,2,-3)); + localCreateRigidBody(1, startTransform,boxShape); + } + } + + //m_debugMode |= btIDebugDraw::DBG_DrawWireframe; + +} + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::shootTrimesh(const btVector3& destination) +{ + + if (m_dynamicsWorld) + { + float mass = 4.f; + btTransform startTransform; + startTransform.setIdentity(); + btVector3 camPos = getCameraPosition(); + startTransform.setOrigin(camPos); + + btRigidBody* body = this->localCreateRigidBody(mass, startTransform,m_trimeshShape2); + + btVector3 linVel(destination[0]-camPos[0],destination[1]-camPos[1],destination[2]-camPos[2]); + linVel.normalize(); + linVel*=m_ShootBoxInitialSpeed*0.25; + + body->getWorldTransform().setOrigin(camPos); + body->getWorldTransform().setRotation(btQuaternion(0,0,0,1)); + body->setLinearVelocity(linVel); + body->setAngularVelocity(btVector3(0,0,0)); + } +} + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::clientMoveAndDisplay() +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + +#define USE_KINEMATIC_GROUND +#ifdef USE_KINEMATIC_GROUND + //kinTorusTran = btVector3(-0.05,0,0); + //kinTorusRot = btQuaternion(0,3.14159265*0.1,0); + + //kinematic object + btCollisionObject* colObj = kinematicTorus; + //is this a rigidbody with a motionstate? then use the motionstate to update positions! + if (btRigidBody::upcast(colObj) && btRigidBody::upcast(colObj)->getMotionState()) + { + btTransform newTrans; + btRigidBody::upcast(colObj)->getMotionState()->getWorldTransform(newTrans); + + newTrans.getOrigin() += kinTorusTran; + newTrans.getBasis() = newTrans.getBasis() * btMatrix3x3(kinTorusRot); + if(newTrans.getOrigin().getX() > 6.0){ + newTrans.getOrigin().setX(6.0); + kinTorusTran = -kinTorusTran; + } + if(newTrans.getOrigin().getX() < -6.0){ + newTrans.getOrigin().setX(-6.0); + kinTorusTran = -kinTorusTran; + } + + btRigidBody::upcast(colObj)->getMotionState()->setWorldTransform(newTrans); + } else + { + /* + btTransform &newTrans = m_dynamicsWorld->getCollisionObjectArray()[0]->getWorldTransform(); + newTrans.getOrigin() += kinTorusTran; + if(newTrans.getOrigin().getX() > 0.1) kinTorusTran = -kinTorusTran; + if(newTrans.getOrigin().getX() < 0.1) kinTorusTran = -kinTorusTran; + */ + } + +#endif //USE_KINEMATIC_GROUND + + unsigned long int time = m_clock.getTimeMilliseconds(); + //float dt = float(m_clock.getTimeMicroseconds()) * dts; //0.000001f; + float dt = float(m_clock.getTimeMicroseconds()) * 0.000001f; + + printf("%i time %i ms \n",m_steps_done,time); + + m_clock.reset(); + m_dynamicsWorld->stepSimulation(dt); + m_steps_done++; + + //m_dynamicsWorld->stepSimulation(dts); + + renderme(); + + glFlush(); + glutSwapBuffers(); + +} + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::displayCallback(void) { + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + renderme(); + + glFlush(); + glutSwapBuffers(); +} + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::clientResetScene() +{ + m_steps_done = 0; + DemoApplication::clientResetScene(); +} + +#define KEY_ESCAPE 0x1B + + +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::keyboardCallback(unsigned char key, int x, int y) +{ + switch (key) + { + case '.': + { + shootTrimesh(getCameraTargetPosition()); + break; + } + + case '2': + { + dts += 0.000001f; + break; + } + case '3': + { + dts -= 0.000001f; if(dts<0.000001f) dts = 0.000001f; + break; + } + + default: + DemoApplication::keyboardCallback(key, x, y); + } +} + +/* +//------------------------------------------------------------------------------ +void GimpactConcaveDemo::keyboardCallback(unsigned char key, int x, int y) +{ + m_lastKey = 0; + + switch (key) + { + case 'q' : + case KEY_ESCAPE : + exit(0); break; + + + //GLUT_KEY_LEFT + case 'l' : stepLeft(); break; + case 'r' : stepRight(); break; + case 'f' : stepFront(); break; + case 'b' : stepBack(); break; + case 'z' : zoomIn(); break; + case 'x' : zoomOut(); break; + case 'i' : toggleIdle(); break; + case 'h': + if (m_debugMode & btIDebugDraw::DBG_NoHelpText) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoHelpText); + else + m_debugMode |= btIDebugDraw::DBG_NoHelpText; + break; + + case 'w': + if (m_debugMode & btIDebugDraw::DBG_DrawWireframe) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawWireframe); + else + m_debugMode |= btIDebugDraw::DBG_DrawWireframe; + break; + + case 'p': + if (m_debugMode & btIDebugDraw::DBG_ProfileTimings) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_ProfileTimings); + else + m_debugMode |= btIDebugDraw::DBG_ProfileTimings; + break; + + case 'm': + if (m_debugMode & btIDebugDraw::DBG_EnableSatComparison) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_EnableSatComparison); + else + m_debugMode |= btIDebugDraw::DBG_EnableSatComparison; + break; + + case 'n': + if (m_debugMode & btIDebugDraw::DBG_DisableBulletLCP) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DisableBulletLCP); + else + m_debugMode |= btIDebugDraw::DBG_DisableBulletLCP; + break; + + case 't' : + if (m_debugMode & btIDebugDraw::DBG_DrawText) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawText); + else + m_debugMode |= btIDebugDraw::DBG_DrawText; + break; + case 'y': + if (m_debugMode & btIDebugDraw::DBG_DrawFeaturesText) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawFeaturesText); + else + m_debugMode |= btIDebugDraw::DBG_DrawFeaturesText; + break; + case 'a': + if (m_debugMode & btIDebugDraw::DBG_DrawAabb){ + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawAabb); + //printf("Not Draw AABB \n"); + }else{ + m_debugMode |= btIDebugDraw::DBG_DrawAabb; + //printf("Draw AABB \n"); + } + break; + case 'c' : + if (m_debugMode & btIDebugDraw::DBG_DrawContactPoints) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawContactPoints); + else + m_debugMode |= btIDebugDraw::DBG_DrawContactPoints; + break; + + case 'd' : + if (m_debugMode & btIDebugDraw::DBG_NoDeactivation) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoDeactivation); + else + m_debugMode |= btIDebugDraw::DBG_NoDeactivation; + if (m_debugMode | btIDebugDraw::DBG_NoDeactivation) + { + gDisableDeactivation = true; + } else + { + gDisableDeactivation = false; + } + break; + + + + + case 'o' : + { + m_stepping = !m_stepping; + break; + } + case 's' : clientMoveAndDisplay(); break; + // case ' ' : newRandom(); break; + case ' ': + clientResetScene(); + break; + case '1': + { + if (m_debugMode & btIDebugDraw::DBG_EnableCCD) + m_debugMode = m_debugMode & (~btIDebugDraw::DBG_EnableCCD); + else + m_debugMode |= btIDebugDraw::DBG_EnableCCD; + break; + } + + case '.': + { + shootTrimesh(getCameraTargetPosition()); + break; + } + + case '+': + { + m_ShootBoxInitialSpeed += 10.f; + break; + } + case '-': + { + m_ShootBoxInitialSpeed -= 10.f; + break; + } + + default: + // std::cout << "unused key : " << key << std::endl; + break; + } + + if (getDynamicsWorld() && getDynamicsWorld()->getDebugDrawer()) + getDynamicsWorld()->getDebugDrawer()->setDebugMode(m_debugMode); + + glutPostRedisplay(); + +} +*/ + diff --git a/Demos/GimpactTestDemo/GimpactTestDemo.h b/Demos/GimpactTestDemo/GimpactTestDemo.h new file mode 100644 index 000000000..26d58f598 --- /dev/null +++ b/Demos/GimpactTestDemo/GimpactTestDemo.h @@ -0,0 +1,99 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef TEST_CONCAVE_DEMO_H +#define TEST_CONCAVE_DEMO_H + +#include "DemoApplication.h" + +struct btCollisionAlgorithmCreateFunc; + +///GimpactConcaveDemo shows usage of static concave triangle meshes +///It also shows per-triangle material (friction/restitution) through CustomMaterialCombinerCallback +class GimpactConcaveDemo : public DemoApplication +{ + +public: + GimpactConcaveDemo() + : m_trimeshShape(NULL), + m_trimeshShape2(NULL), + m_indexVertexArrays(NULL), + m_indexVertexArrays2(NULL), + m_collisionConfiguration(NULL), + m_dispatcher(NULL), + m_broadphase(NULL), + m_constraintSolver(NULL), + m_gimpactCollisionCreateFunc(NULL), + m_steps_done(0) + { + } + + virtual ~GimpactConcaveDemo() + { + delete m_indexVertexArrays; + delete m_trimeshShape; + + delete m_indexVertexArrays2; + delete m_trimeshShape2; + + delete m_gimpactCollisionCreateFunc; + + delete m_collisionConfiguration; + delete m_dispatcher; + delete m_broadphase; + delete m_constraintSolver; + + delete m_dynamicsWorld; + } + + void initGImpactCollision(); + void initPhysics(); + + virtual void clientMoveAndDisplay(); + + virtual void displayCallback(); + + virtual void clientResetScene(); + + virtual void renderme(); + virtual void keyboardCallback(unsigned char key, int x, int y); + + ///Demo functions + void shootTrimesh(const btVector3& destination); + +public: ///data + unsigned int m_steps_done; + + btCollisionShape *m_trimeshShape; + btCollisionShape *m_trimeshShape2; + + + btTriangleIndexVertexArray *m_indexVertexArrays; + btTriangleIndexVertexArray *m_indexVertexArrays2; + + btVector3 kinTorusTran; + btQuaternion kinTorusRot; + btRigidBody *kinematicTorus; + + + btCollisionAlgorithmCreateFunc* m_gimpactCollisionCreateFunc; + + btDefaultCollisionConfiguration* m_collisionConfiguration; + btCollisionDispatcher* m_dispatcher; + btBroadphaseInterface* m_broadphase; + btConstraintSolver* m_constraintSolver; +}; + +#endif //CONCAVE_DEMO_H + diff --git a/Demos/GimpactTestDemo/TorusMesh.h b/Demos/GimpactTestDemo/TorusMesh.h new file mode 100644 index 000000000..4fb615ccb --- /dev/null +++ b/Demos/GimpactTestDemo/TorusMesh.h @@ -0,0 +1,921 @@ +#ifndef TORUS_MESH_H_ +#define TORUS_MESH_H_ + + +//*************************** NOT REALLY FAMOUS TORUS ********************************************// + +#define Real btScalar +const int NUM_TRIANGLES =600; +const int NUM_VERTICES = 300; +const int NUM_INDICES = NUM_TRIANGLES * 3; + + +Real gVertices[NUM_VERTICES * 3] = { + Real(2.5), Real(0), Real(0), + Real(2.405), Real(0.294), Real(0), + Real(2.155), Real(0.476), Real(0), + Real(1.845), Real(0.476), Real(0), + Real(1.595), Real(0.294), Real(0), + Real(1.5), Real(0 ), Real(0), + Real(1.595), Real(-0.294), Real(0), + Real(1.845), Real(-0.476), Real(0), + Real(2.155), Real(-0.476), Real(0), + Real(2.405), Real(-0.294), Real(0), + Real(2.445), Real(0 ), Real(0.52 ), + Real(2.352), Real(0.294), Real(0.5 ), + Real(2.107), Real(0.476), Real(0.448), + Real(1.805), Real(0.476), Real(0.384), + Real(1.561), Real(0.294), Real(0.332), + Real(1.467), Real(0 ), Real(0.312), + Real(1.561), Real(-0.294), Real(0.332), + Real(1.805), Real(-0.476), Real(0.384), + Real(2.107), Real(-0.476), Real(0.448), + Real(2.352), Real(-0.294), Real(0.5 ), + Real(2.284), Real(0), Real(1.017), + Real(2.197), Real(0.294), Real(0.978), + Real(1.968), Real(0.476), Real(0.876), + Real(1.686), Real(0.476), Real(0.751), + Real(1.458), Real(0.294), Real(0.649), + Real(1.37), Real(0), Real(0.61 ), + Real(1.458), Real(-0.294), Real(0.649), + Real(1.686), Real(-0.476), Real(0.751), + Real(1.968), Real(-0.476), Real(0.876), + Real(2.197), Real(-0.294), Real(0.978), + Real(2.023), Real(0), Real(1.469), + Real(1.945), Real(0.294), Real(1.413), + Real(1.743), Real(0.476), Real(1.266), + Real(1.493), Real(0.476), Real(1.085), + Real(1.291), Real(0.294), Real(0.938), + Real(1.214), Real(0), Real(0.882), + Real(1.291), Real(-0.294), Real(0.938), + Real(1.493), Real(-0.476), Real(1.085), + Real(1.743), Real(-0.476), Real(1.266), + Real(1.945), Real(-0.294), Real(1.413), + Real(1.673), Real(0), Real(1.858), + Real(1.609), Real(0.294), Real(1.787), + Real(1.442), Real(0.476), Real(1.601), + Real(1.235), Real(0.476), Real(1.371), + Real(1.068), Real(0.294), Real(1.186), + Real(1.004), Real(0), Real(1.115), + Real(1.068), Real(-0.294), Real(1.186), + Real(1.235), Real(-0.476), Real(1.371), + Real(1.442), Real(-0.476), Real(1.601), + Real(1.609), Real(-0.294), Real(1.787), + Real(1.25), Real(0), Real(2.165), + Real(1.202), Real(0.294), Real(2.082), + Real(1.077), Real(0.476), Real(1.866), + Real(0.923), Real(0.476), Real(1.598), + Real(0.798), Real(0.294), Real(1.382), + Real(0.75), Real(0), Real(1.299), + Real(0.798), Real(-0.294), Real(1.382), + Real(0.923), Real(-0.476), Real(1.598), + Real(1.077), Real(-0.476), Real(1.866), + Real(1.202), Real(-0.294), Real(2.082), + Real(0.773), Real(0), Real(2.378), + Real(0.743), Real(0.294), Real(2.287), + Real(0.666), Real(0.476), Real(2.049), + Real(0.57), Real(0.476), Real(1.755), + Real(0.493), Real(0.294), Real(1.517), + Real(0.464), Real(0), Real(1.427), + Real(0.493), Real(-0.294), Real(1.517), + Real(0.57), Real(-0.476), Real(1.755), + Real(0.666), Real(-0.476), Real(2.049), + Real(0.743), Real(-0.294), Real(2.287), + Real(0.261), Real(0), Real(2.486), + Real(0.251), Real(0.294), Real(2.391), + Real(0.225), Real(0.476), Real(2.143), + Real(0.193), Real(0.476), Real(1.835), + Real(0.167), Real(0.294), Real(1.587), + Real(0.157), Real(0), Real(1.492), + Real(0.167), Real(-0.294), Real(1.587), + Real(0.193), Real(-0.476), Real(1.835), + Real(0.225), Real(-0.476), Real(2.143), + Real(0.251), Real(-0.294), Real(2.391), + Real(-0.261), Real(0), Real(2.486), + Real(-0.251), Real(0.294), Real(2.391), + Real(-0.225), Real(0.476), Real(2.143), + Real(-0.193), Real(0.476), Real(1.835), + Real(-0.167), Real(0.294), Real(1.587), + Real(-0.157), Real(0), Real(1.492), + Real(-0.167), Real(-0.294), Real(1.587), + Real(-0.193), Real(-0.476), Real(1.835), + Real(-0.225), Real(-0.476), Real(2.143), + Real(-0.251), Real(-0.294), Real(2.391), + Real(-0.773), Real(0), Real(2.378), + Real(-0.743), Real(0.294), Real(2.287), + Real(-0.666), Real(0.476), Real(2.049), + Real(-0.57), Real(0.476), Real(1.755), + Real(-0.493), Real(0.294), Real(1.517), + Real(-0.464), Real(0), Real(1.427), + Real(-0.493), Real(-0.294), Real(1.517), + Real(-0.57), Real(-0.476), Real(1.755), + Real(-0.666), Real(-0.476), Real(2.049), + Real(-0.743), Real(-0.294), Real(2.287), + Real(-1.25 ), Real(0), Real(2.165), + Real(-1.202), Real(0.294), Real(2.082), + Real(-1.077), Real(0.476), Real(1.866), + Real(-0.923), Real(0.476), Real(1.598), + Real(-0.798), Real(0.294), Real(1.382), + Real(-0.75), Real(0), Real(1.299), + Real(-0.798), Real(-0.294), Real(1.382), + Real(-0.923), Real(-0.476), Real(1.598), + Real(-1.077), Real(-0.476), Real(1.866), + Real(-1.202), Real(-0.294), Real(2.082), + Real(-1.673), Real(0), Real(1.858), + Real(-1.609), Real(0.294), Real(1.787), + Real(-1.442), Real(0.476), Real(1.601), + Real(-1.235), Real(0.476), Real(1.371), + Real(-1.068), Real(0.294), Real(1.186), + Real(-1.004), Real(0), Real(1.115), + Real(-1.068), Real(-0.294), Real(1.186), + Real(-1.235), Real(-0.476), Real(1.371), + Real(-1.442), Real(-0.476), Real(1.601), + Real(-1.609), Real(-0.294), Real(1.787), + Real(-2.023), Real(0), Real(1.469), + Real(-1.945), Real(0.294), Real(1.413), + Real(-1.743), Real(0.476), Real(1.266), + Real(-1.493), Real(0.476), Real(1.085), + Real(-1.291), Real(0.294), Real(0.938), + Real(-1.214), Real(0), Real(0.882), + Real(-1.291), Real(-0.294), Real(0.938), + Real(-1.493), Real(-0.476), Real(1.085), + Real(-1.743), Real(-0.476), Real(1.266), + Real(-1.945), Real(-0.294), Real(1.413), + Real(-2.284), Real(0), Real(1.017), + Real(-2.197), Real(0.294), Real(0.978), + Real(-1.968), Real(0.476), Real(0.876), + Real(-1.686), Real(0.476), Real(0.751), + Real(-1.458), Real(0.294), Real(0.649), + Real(-1.37), Real(0), Real(0.61 ), + Real(-1.458), Real(-0.294), Real(0.649), + Real(-1.686), Real(-0.476), Real(0.751), + Real(-1.968), Real(-0.476), Real(0.876), + Real(-2.197), Real(-0.294), Real(0.978), + Real(-2.445), Real(0), Real(0.52), + Real(-2.352), Real(0.294), Real(0.5), + Real(-2.107), Real(0.476), Real(0.448), + Real(-1.805), Real(0.476), Real(0.384), + Real(-1.561), Real(0.294), Real(0.332), + Real(-1.467), Real(0), Real(0.312), + Real(-1.561), Real(-0.294), Real(0.332), + Real(-1.805), Real(-0.476), Real(0.384), + Real(-2.107), Real(-0.476), Real(0.448), + Real(-2.352), Real(-0.294), Real(0.5), + Real(-2.5 ), Real(0), Real(0), + Real(-2.405), Real(0.294), Real(0), + Real(-2.155), Real(0.476), Real(0), + Real(-1.845), Real(0.476), Real(0), + Real(-1.595), Real(0.294), Real(0), + Real(-1.5), Real(0), Real(0), + Real(-1.595), Real(-0.294), Real(0), + Real(-1.845), Real(-0.476), Real(0), + Real(-2.155), Real(-0.476), Real(0), + Real(-2.405), Real(-0.294), Real(0), + Real(-2.445), Real(0), Real(-0.52), + Real(-2.352), Real(0.294), Real(-0.5), + Real(-2.107), Real(0.476), Real(-0.448), + Real(-1.805), Real(0.476), Real(-0.384), + Real(-1.561), Real(0.294), Real(-0.332), + Real(-1.467), Real(0), Real(-0.312), + Real(-1.561), Real(-0.294), Real(-0.332), + Real(-1.805), Real(-0.476), Real(-0.384), + Real(-2.107), Real(-0.476), Real(-0.448), + Real(-2.352), Real(-0.294), Real(-0.5), + Real(-2.284), Real(0), Real(-1.017), + Real(-2.197), Real(0.294), Real(-0.978), + Real(-1.968), Real(0.476), Real(-0.876), + Real(-1.686), Real(0.476), Real(-0.751), + Real(-1.458), Real(0.294), Real(-0.649), + Real(-1.37), Real(0), Real(-0.61), + Real(-1.458), Real(-0.294), Real(-0.649), + Real(-1.686), Real(-0.476), Real(-0.751), + Real(-1.968), Real(-0.476), Real(-0.876), + Real(-2.197), Real(-0.294), Real(-0.978), + Real(-2.023), Real(0), Real(-1.469), + Real(-1.945), Real(0.294), Real(-1.413), + Real(-1.743), Real(0.476), Real(-1.266), + Real(-1.493), Real(0.476), Real(-1.085), + Real(-1.291), Real(0.294), Real(-0.938), + Real(-1.214), Real(0), Real(-0.882), + Real(-1.291), Real(-0.294), Real(-0.938), + Real(-1.493), Real(-0.476), Real(-1.085), + Real(-1.743), Real(-0.476), Real(-1.266), + Real(-1.945), Real(-0.294), Real(-1.413), + Real(-1.673), Real(0), Real(-1.858), + Real(-1.609), Real(0.294), Real(-1.787), + Real(-1.442), Real(0.476), Real(-1.601), + Real(-1.235), Real(0.476), Real(-1.371), + Real(-1.068), Real(0.294), Real(-1.186), + Real(-1.004), Real(0), Real(-1.115), + Real(-1.068), Real(-0.294), Real(-1.186), + Real(-1.235), Real(-0.476), Real(-1.371), + Real(-1.442), Real(-0.476), Real(-1.601), + Real(-1.609), Real(-0.294), Real(-1.787), + Real(-1.25 ), Real(0), Real(-2.165), + Real(-1.202), Real(0.294), Real(-2.082), + Real(-1.077), Real(0.476), Real(-1.866), + Real(-0.923), Real(0.476), Real(-1.598), + Real(-0.798), Real(0.294), Real(-1.382), + Real(-0.75), Real(0), Real(-1.299), + Real(-0.798), Real(-0.294), Real(-1.382), + Real(-0.923), Real(-0.476), Real(-1.598), + Real(-1.077), Real(-0.476), Real(-1.866), + Real(-1.202), Real(-0.294), Real(-2.082), + Real(-0.773), Real(0), Real(-2.378), + Real(-0.743), Real(0.294), Real(-2.287), + Real(-0.666), Real(0.476), Real(-2.049), + Real(-0.57), Real(0.476), Real(-1.755), + Real(-0.493), Real(0.294), Real(-1.517), + Real(-0.464), Real(0), Real(-1.427), + Real(-0.493), Real(-0.294), Real(-1.517), + Real(-0.57), Real(-0.476), Real(-1.755), + Real(-0.666), Real(-0.476), Real(-2.049), + Real(-0.743), Real(-0.294), Real(-2.287), + Real(-0.261), Real(0), Real(-2.486), + Real(-0.251), Real(0.294), Real(-2.391), + Real(-0.225), Real(0.476), Real(-2.143), + Real(-0.193), Real(0.476), Real(-1.835), + Real(-0.167), Real(0.294), Real(-1.587), + Real(-0.157), Real(0), Real(-1.492), + Real(-0.167), Real(-0.294), Real(-1.587), + Real(-0.193), Real(-0.476), Real(-1.835), + Real(-0.225), Real(-0.476), Real(-2.143), + Real(-0.251), Real(-0.294), Real(-2.391), + Real(0.261), Real(0), Real(-2.486), + Real(0.251), Real(0.294), Real(-2.391), + Real(0.225), Real(0.476), Real(-2.143), + Real(0.193), Real(0.476), Real(-1.835), + Real(0.167), Real(0.294), Real(-1.587), + Real(0.157), Real(0), Real(-1.492), + Real(0.167), Real(-0.294), Real(-1.587), + Real(0.193), Real(-0.476), Real(-1.835), + Real(0.225), Real(-0.476), Real(-2.143), + Real(0.251), Real(-0.294), Real(-2.391), + Real(0.773), Real(0), Real(-2.378), + Real(0.743), Real(0.294), Real(-2.287), + Real(0.666), Real(0.476), Real(-2.049), + Real(0.57), Real(0.476), Real(-1.755), + Real(0.493), Real(0.294), Real(-1.517), + Real(0.464), Real(0), Real(-1.427), + Real(0.493), Real(-0.294), Real(-1.517), + Real(0.57), Real(-0.476), Real(-1.755), + Real(0.666), Real(-0.476), Real(-2.049), + Real(0.743), Real(-0.294), Real(-2.287), + Real(1.25), Real(0), Real(-2.165), + Real(1.202), Real(0.294), Real(-2.082), + Real(1.077), Real(0.476), Real(-1.866), + Real(0.923), Real(0.476), Real(-1.598), + Real(0.798), Real(0.294), Real(-1.382), + Real(0.75), Real(0), Real(-1.299), + Real(0.798), Real(-0.294), Real(-1.382), + Real(0.923), Real(-0.476), Real(-1.598), + Real(1.077), Real(-0.476), Real(-1.866), + Real(1.202), Real(-0.294), Real(-2.082), + Real(1.673), Real(0), Real(-1.858), + Real(1.609), Real(0.294), Real(-1.787), + Real(1.442), Real(0.476), Real(-1.601), + Real(1.235), Real(0.476), Real(-1.371), + Real(1.068), Real(0.294), Real(-1.186), + Real(1.004), Real(0), Real(-1.115), + Real(1.068), Real(-0.294), Real(-1.186), + Real(1.235), Real(-0.476), Real(-1.371), + Real(1.442), Real(-0.476), Real(-1.601), + Real(1.609), Real(-0.294), Real(-1.787), + Real(2.023), Real(0), Real(-1.469), + Real(1.945), Real(0.294), Real(-1.413), + Real(1.743), Real(0.476), Real(-1.266), + Real(1.493), Real(0.476), Real(-1.085), + Real(1.291), Real(0.294), Real(-0.938), + Real(1.214), Real(0), Real(-0.882), + Real(1.291), Real(-0.294), Real(-0.938), + Real(1.493), Real(-0.476), Real(-1.085), + Real(1.743), Real(-0.476), Real(-1.266), + Real(1.945), Real(-0.294), Real(-1.413), + Real(2.284), Real(0), Real(-1.017), + Real(2.197), Real(0.294), Real(-0.978), + Real(1.968), Real(0.476), Real(-0.876), + Real(1.686), Real(0.476), Real(-0.751), + Real(1.458), Real(0.294), Real(-0.649), + Real(1.37), Real(0), Real(-0.61 ), + Real(1.458), Real(-0.294), Real(-0.649), + Real(1.686), Real(-0.476), Real(-0.751), + Real(1.968), Real(-0.476), Real(-0.876), + Real(2.197), Real(-0.294), Real(-0.978), + Real(2.445), Real(0), Real(-0.52 ), + Real(2.352), Real(0.294), Real(-0.5 ), + Real(2.107), Real(0.476), Real(-0.448), + Real(1.805), Real(0.476), Real(-0.384), + Real(1.561), Real(0.294), Real(-0.332), + Real(1.467), Real(0), Real(-0.312), + Real(1.561), Real(-0.294), Real(-0.332), + Real(1.805), Real(-0.476), Real(-0.384), + Real(2.107), Real(-0.476), Real(-0.448), + Real(2.352), Real(-0.294), Real(-0.5) +}; + + +int gIndices[NUM_TRIANGLES][3] = { + {0, 1, 11}, + {1, 2, 12}, + {2, 3, 13}, + {3, 4, 14}, + {4, 5, 15}, + {5, 6, 16}, + {6, 7, 17}, + {7, 8, 18}, + {8, 9, 19}, + {9, 0, 10}, + {10, 11, 21}, + {11, 12, 22}, + {12, 13, 23}, + {13, 14, 24}, + {14, 15, 25}, + {15, 16, 26}, + {16, 17, 27}, + {17, 18, 28}, + {18, 19, 29}, + {19, 10, 20}, + {20, 21, 31}, + {21, 22, 32}, + {22, 23, 33}, + {23, 24, 34}, + {24, 25, 35}, + {25, 26, 36}, + {26, 27, 37}, + {27, 28, 38}, + {28, 29, 39}, + {29, 20, 30}, + {30, 31, 41}, + {31, 32, 42}, + {32, 33, 43}, + {33, 34, 44}, + {34, 35, 45}, + {35, 36, 46}, + {36, 37, 47}, + {37, 38, 48}, + {38, 39, 49}, + {39, 30, 40}, + {40, 41, 51}, + {41, 42, 52}, + {42, 43, 53}, + {43, 44, 54}, + {44, 45, 55}, + {45, 46, 56}, + {46, 47, 57}, + {47, 48, 58}, + {48, 49, 59}, + {49, 40, 50}, + {50, 51, 61}, + {51, 52, 62}, + {52, 53, 63}, + {53, 54, 64}, + {54, 55, 65}, + {55, 56, 66}, + {56, 57, 67}, + {57, 58, 68}, + {58, 59, 69}, + {59, 50, 60}, + {60, 61, 71}, + {61, 62, 72}, + {62, 63, 73}, + {63, 64, 74}, + {64, 65, 75}, + {65, 66, 76}, + {66, 67, 77}, + {67, 68, 78}, + {68, 69, 79}, + {69, 60, 70}, + {70, 71, 81}, + {71, 72, 82}, + {72, 73, 83}, + {73, 74, 84}, + {74, 75, 85}, + {75, 76, 86}, + {76, 77, 87}, + {77, 78, 88}, + {78, 79, 89}, + {79, 70, 80}, + {80, 81, 91}, + {81, 82, 92}, + {82, 83, 93}, + {83, 84, 94}, + {84, 85, 95}, + {85, 86, 96}, + {86, 87, 97}, + {87, 88, 98}, + {88, 89, 99}, + {89, 80, 90}, + {90, 91, 101}, + {91, 92, 102}, + {92, 93, 103}, + {93, 94, 104}, + {94, 95, 105}, + {95, 96, 106}, + {96, 97, 107}, + {97, 98, 108}, + {98, 99, 109}, + {99, 90, 100}, + {100, 101, 111}, + {101, 102, 112}, + {102, 103, 113}, + {103, 104, 114}, + {104, 105, 115}, + {105, 106, 116}, + {106, 107, 117}, + {107, 108, 118}, + {108, 109, 119}, + {109, 100, 110}, + {110, 111, 121}, + {111, 112, 122}, + {112, 113, 123}, + {113, 114, 124}, + {114, 115, 125}, + {115, 116, 126}, + {116, 117, 127}, + {117, 118, 128}, + {118, 119, 129}, + {119, 110, 120}, + {120, 121, 131}, + {121, 122, 132}, + {122, 123, 133}, + {123, 124, 134}, + {124, 125, 135}, + {125, 126, 136}, + {126, 127, 137}, + {127, 128, 138}, + {128, 129, 139}, + {129, 120, 130}, + {130, 131, 141}, + {131, 132, 142}, + {132, 133, 143}, + {133, 134, 144}, + {134, 135, 145}, + {135, 136, 146}, + {136, 137, 147}, + {137, 138, 148}, + {138, 139, 149}, + {139, 130, 140}, + {140, 141, 151}, + {141, 142, 152}, + {142, 143, 153}, + {143, 144, 154}, + {144, 145, 155}, + {145, 146, 156}, + {146, 147, 157}, + {147, 148, 158}, + {148, 149, 159}, + {149, 140, 150}, + {150, 151, 161}, + {151, 152, 162}, + {152, 153, 163}, + {153, 154, 164}, + {154, 155, 165}, + {155, 156, 166}, + {156, 157, 167}, + {157, 158, 168}, + {158, 159, 169}, + {159, 150, 160}, + {160, 161, 171}, + {161, 162, 172}, + {162, 163, 173}, + {163, 164, 174}, + {164, 165, 175}, + {165, 166, 176}, + {166, 167, 177}, + {167, 168, 178}, + {168, 169, 179}, + {169, 160, 170}, + {170, 171, 181}, + {171, 172, 182}, + {172, 173, 183}, + {173, 174, 184}, + {174, 175, 185}, + {175, 176, 186}, + {176, 177, 187}, + {177, 178, 188}, + {178, 179, 189}, + {179, 170, 180}, + {180, 181, 191}, + {181, 182, 192}, + {182, 183, 193}, + {183, 184, 194}, + {184, 185, 195}, + {185, 186, 196}, + {186, 187, 197}, + {187, 188, 198}, + {188, 189, 199}, + {189, 180, 190}, + {190, 191, 201}, + {191, 192, 202}, + {192, 193, 203}, + {193, 194, 204}, + {194, 195, 205}, + {195, 196, 206}, + {196, 197, 207}, + {197, 198, 208}, + {198, 199, 209}, + {199, 190, 200}, + {200, 201, 211}, + {201, 202, 212}, + {202, 203, 213}, + {203, 204, 214}, + {204, 205, 215}, + {205, 206, 216}, + {206, 207, 217}, + {207, 208, 218}, + {208, 209, 219}, + {209, 200, 210}, + {210, 211, 221}, + {211, 212, 222}, + {212, 213, 223}, + {213, 214, 224}, + {214, 215, 225}, + {215, 216, 226}, + {216, 217, 227}, + {217, 218, 228}, + {218, 219, 229}, + {219, 210, 220}, + {220, 221, 231}, + {221, 222, 232}, + {222, 223, 233}, + {223, 224, 234}, + {224, 225, 235}, + {225, 226, 236}, + {226, 227, 237}, + {227, 228, 238}, + {228, 229, 239}, + {229, 220, 230}, + {230, 231, 241}, + {231, 232, 242}, + {232, 233, 243}, + {233, 234, 244}, + {234, 235, 245}, + {235, 236, 246}, + {236, 237, 247}, + {237, 238, 248}, + {238, 239, 249}, + {239, 230, 240}, + {240, 241, 251}, + {241, 242, 252}, + {242, 243, 253}, + {243, 244, 254}, + {244, 245, 255}, + {245, 246, 256}, + {246, 247, 257}, + {247, 248, 258}, + {248, 249, 259}, + {249, 240, 250}, + {250, 251, 261}, + {251, 252, 262}, + {252, 253, 263}, + {253, 254, 264}, + {254, 255, 265}, + {255, 256, 266}, + {256, 257, 267}, + {257, 258, 268}, + {258, 259, 269}, + {259, 250, 260}, + {260, 261, 271}, + {261, 262, 272}, + {262, 263, 273}, + {263, 264, 274}, + {264, 265, 275}, + {265, 266, 276}, + {266, 267, 277}, + {267, 268, 278}, + {268, 269, 279}, + {269, 260, 270}, + {270, 271, 281}, + {271, 272, 282}, + {272, 273, 283}, + {273, 274, 284}, + {274, 275, 285}, + {275, 276, 286}, + {276, 277, 287}, + {277, 278, 288}, + {278, 279, 289}, + {279, 270, 280}, + {280, 281, 291}, + {281, 282, 292}, + {282, 283, 293}, + {283, 284, 294}, + {284, 285, 295}, + {285, 286, 296}, + {286, 287, 297}, + {287, 288, 298}, + {288, 289, 299}, + {289, 280, 290}, + {290, 291, 1}, + {291, 292, 2}, + {292, 293, 3}, + {293, 294, 4}, + {294, 295, 5}, + {295, 296, 6}, + {296, 297, 7}, + {297, 298, 8}, + {298, 299, 9}, + {299, 290, 0}, + {0, 11, 10}, + {1, 12, 11}, + {2, 13, 12}, + {3, 14, 13}, + {4, 15, 14}, + {5, 16, 15}, + {6, 17, 16}, + {7, 18, 17}, + {8, 19, 18}, + {9, 10, 19}, + {10, 21, 20}, + {11, 22, 21}, + {12, 23, 22}, + {13, 24, 23}, + {14, 25, 24}, + {15, 26, 25}, + {16, 27, 26}, + {17, 28, 27}, + {18, 29, 28}, + {19, 20, 29}, + {20, 31, 30}, + {21, 32, 31}, + {22, 33, 32}, + {23, 34, 33}, + {24, 35, 34}, + {25, 36, 35}, + {26, 37, 36}, + {27, 38, 37}, + {28, 39, 38}, + {29, 30, 39}, + {30, 41, 40}, + {31, 42, 41}, + {32, 43, 42}, + {33, 44, 43}, + {34, 45, 44}, + {35, 46, 45}, + {36, 47, 46}, + {37, 48, 47}, + {38, 49, 48}, + {39, 40, 49}, + {40, 51, 50}, + {41, 52, 51}, + {42, 53, 52}, + {43, 54, 53}, + {44, 55, 54}, + {45, 56, 55}, + {46, 57, 56}, + {47, 58, 57}, + {48, 59, 58}, + {49, 50, 59}, + {50, 61, 60}, + {51, 62, 61}, + {52, 63, 62}, + {53, 64, 63}, + {54, 65, 64}, + {55, 66, 65}, + {56, 67, 66}, + {57, 68, 67}, + {58, 69, 68}, + {59, 60, 69}, + {60, 71, 70}, + {61, 72, 71}, + {62, 73, 72}, + {63, 74, 73}, + {64, 75, 74}, + {65, 76, 75}, + {66, 77, 76}, + {67, 78, 77}, + {68, 79, 78}, + {69, 70, 79}, + {70, 81, 80}, + {71, 82, 81}, + {72, 83, 82}, + {73, 84, 83}, + {74, 85, 84}, + {75, 86, 85}, + {76, 87, 86}, + {77, 88, 87}, + {78, 89, 88}, + {79, 80, 89}, + {80, 91, 90}, + {81, 92, 91}, + {82, 93, 92}, + {83, 94, 93}, + {84, 95, 94}, + {85, 96, 95}, + {86, 97, 96}, + {87, 98, 97}, + {88, 99, 98}, + {89, 90, 99}, + {90, 101, 100}, + {91, 102, 101}, + {92, 103, 102}, + {93, 104, 103}, + {94, 105, 104}, + {95, 106, 105}, + {96, 107, 106}, + {97, 108, 107}, + {98, 109, 108}, + {99, 100, 109}, + {100, 111, 110}, + {101, 112, 111}, + {102, 113, 112}, + {103, 114, 113}, + {104, 115, 114}, + {105, 116, 115}, + {106, 117, 116}, + {107, 118, 117}, + {108, 119, 118}, + {109, 110, 119}, + {110, 121, 120}, + {111, 122, 121}, + {112, 123, 122}, + {113, 124, 123}, + {114, 125, 124}, + {115, 126, 125}, + {116, 127, 126}, + {117, 128, 127}, + {118, 129, 128}, + {119, 120, 129}, + {120, 131, 130}, + {121, 132, 131}, + {122, 133, 132}, + {123, 134, 133}, + {124, 135, 134}, + {125, 136, 135}, + {126, 137, 136}, + {127, 138, 137}, + {128, 139, 138}, + {129, 130, 139}, + {130, 141, 140}, + {131, 142, 141}, + {132, 143, 142}, + {133, 144, 143}, + {134, 145, 144}, + {135, 146, 145}, + {136, 147, 146}, + {137, 148, 147}, + {138, 149, 148}, + {139, 140, 149}, + {140, 151, 150}, + {141, 152, 151}, + {142, 153, 152}, + {143, 154, 153}, + {144, 155, 154}, + {145, 156, 155}, + {146, 157, 156}, + {147, 158, 157}, + {148, 159, 158}, + {149, 150, 159}, + {150, 161, 160}, + {151, 162, 161}, + {152, 163, 162}, + {153, 164, 163}, + {154, 165, 164}, + {155, 166, 165}, + {156, 167, 166}, + {157, 168, 167}, + {158, 169, 168}, + {159, 160, 169}, + {160, 171, 170}, + {161, 172, 171}, + {162, 173, 172}, + {163, 174, 173}, + {164, 175, 174}, + {165, 176, 175}, + {166, 177, 176}, + {167, 178, 177}, + {168, 179, 178}, + {169, 170, 179}, + {170, 181, 180}, + {171, 182, 181}, + {172, 183, 182}, + {173, 184, 183}, + {174, 185, 184}, + {175, 186, 185}, + {176, 187, 186}, + {177, 188, 187}, + {178, 189, 188}, + {179, 180, 189}, + {180, 191, 190}, + {181, 192, 191}, + {182, 193, 192}, + {183, 194, 193}, + {184, 195, 194}, + {185, 196, 195}, + {186, 197, 196}, + {187, 198, 197}, + {188, 199, 198}, + {189, 190, 199}, + {190, 201, 200}, + {191, 202, 201}, + {192, 203, 202}, + {193, 204, 203}, + {194, 205, 204}, + {195, 206, 205}, + {196, 207, 206}, + {197, 208, 207}, + {198, 209, 208}, + {199, 200, 209}, + {200, 211, 210}, + {201, 212, 211}, + {202, 213, 212}, + {203, 214, 213}, + {204, 215, 214}, + {205, 216, 215}, + {206, 217, 216}, + {207, 218, 217}, + {208, 219, 218}, + {209, 210, 219}, + {210, 221, 220}, + {211, 222, 221}, + {212, 223, 222}, + {213, 224, 223}, + {214, 225, 224}, + {215, 226, 225}, + {216, 227, 226}, + {217, 228, 227}, + {218, 229, 228}, + {219, 220, 229}, + {220, 231, 230}, + {221, 232, 231}, + {222, 233, 232}, + {223, 234, 233}, + {224, 235, 234}, + {225, 236, 235}, + {226, 237, 236}, + {227, 238, 237}, + {228, 239, 238}, + {229, 230, 239}, + {230, 241, 240}, + {231, 242, 241}, + {232, 243, 242}, + {233, 244, 243}, + {234, 245, 244}, + {235, 246, 245}, + {236, 247, 246}, + {237, 248, 247}, + {238, 249, 248}, + {239, 240, 249}, + {240, 251, 250}, + {241, 252, 251}, + {242, 253, 252}, + {243, 254, 253}, + {244, 255, 254}, + {245, 256, 255}, + {246, 257, 256}, + {247, 258, 257}, + {248, 259, 258}, + {249, 250, 259}, + {250, 261, 260}, + {251, 262, 261}, + {252, 263, 262}, + {253, 264, 263}, + {254, 265, 264}, + {255, 266, 265}, + {256, 267, 266}, + {257, 268, 267}, + {258, 269, 268}, + {259, 260, 269}, + {260, 271, 270}, + {261, 272, 271}, + {262, 273, 272}, + {263, 274, 273}, + {264, 275, 274}, + {265, 276, 275}, + {266, 277, 276}, + {267, 278, 277}, + {268, 279, 278}, + {269, 270, 279}, + {270, 281, 280}, + {271, 282, 281}, + {272, 283, 282}, + {273, 284, 283}, + {274, 285, 284}, + {275, 286, 285}, + {276, 287, 286}, + {277, 288, 287}, + {278, 289, 288}, + {279, 280, 289}, + {280, 291, 290}, + {281, 292, 291}, + {282, 293, 292}, + {283, 294, 293}, + {284, 295, 294}, + {285, 296, 295}, + {286, 297, 296}, + {287, 298, 297}, + {288, 299, 298}, + {289, 290, 299}, + {290, 1, 0}, + {291, 2, 1}, + {292, 3, 2}, + {293, 4, 3}, + {294, 5, 4}, + {295, 6, 5}, + {296, 7, 6}, + {297, 8, 7}, + {298, 9, 8}, + {299, 0, 9}, +}; + + +#endif