public override int onThrow(ShapeBase player, int amount) { player.decInventory(this, 1); ObjectCreator tch = new ObjectCreator("ProximityMine", string.Empty); tch["datablock"] = getName(); tch["sourceObject"] = player; tch["rotation"] = new AngAxisF(0, 0, 1, (float) (new Random().NextDouble()*360)); tch["static"] = false; tch["client"] = player["client"]; ProximityMine pm = (tch.Create()); ((SimSet) "MissionCleanup").pushToBack(pm); return pm; }
public override void onAdd(GameBase obj) { WheeledVehicle vehicle = obj._ID; base.onAdd(obj); WheeledVehicleTire CheetahCarTire = "CheetahCarTire"; WheeledVehicleTire CheetahCarTireRear = "CheetahCarTireRear"; WheeledVehicleSpring CheetahCarSpring = "CheetahCarSpring"; //int nsd = (nameSpaceDepth.AsInt() + 1); //console.ParentExecute(datablock, "onAdd", nsd, new string[] { datablock, vehicle.ID }); vehicle.setWheelTire(0, CheetahCarTire); vehicle.setWheelTire(1, CheetahCarTire); vehicle.setWheelTire(2, CheetahCarTireRear); vehicle.setWheelTire(3, CheetahCarTireRear); // Setup the car with some tires & springs for (int i = vehicle.getWheelCount() - 1; i >= 0; i--) { vehicle.setWheelPowered(i, true); vehicle.setWheelSpring(i, CheetahCarSpring); } // Steer with the front tires vehicle.setWheelSteering(0, 1); vehicle.setWheelSteering(1, 1); // Add tail lights ObjectCreator tc = new ObjectCreator("PointLight", ""); tc["radius"] = 1; tc["isEnabled"] = false; tc["color"] = new ColorF(1, 0, 0.141176f, 1); // , @"""1 0 0.141176 1"""); tc["brightness"] = 2; tc["castShadows"] = true; tc["priority"] = 1; tc["animate"] = false; tc["animationPeriod"] = 1; tc["animationPhase"] = 1; tc["flareScale"] = 1; tc["attenuationRatio"] = new Point3F(0, 1, 1); //, @"""0 1 1"""); tc["shadowType"] = "\"DualParaboloidSinglePass\""; tc["texSize"] = 512; tc["overDarkFactor"] = new Point4F(2000, 1000, 500, 100); //, @"""2000 1000 500 100"""); tc["shadowDistance"] = 400; // "400"); tc["shadowSoftness"] = 0.15; tc["numSplits"] = 1; //, "1"); tc["logWeight"] = 0.91; tc["fadeStartDistance"] = 0; //, "0"); tc["lastSplitTerrainOnly"] = false; tc["representedInLightmap"] = false; //, "0"); tc["shadowDarkenColor"] = new ColorF(0, 0, 0, -1); //, @"""0 0 0 -1"""); tc["includeLightmappedGeometryInShadow"] = false; //, "0"); tc["rotation"] = new AngAxisF(1, 0, 0, 0); //, @"""1 0 0 0 """); tc["canSave"] = true; //, "1"); tc["canSaveDynamicFields"] = true; //, "1"); tc["splitFadeDistances"] = "10 20 30 40"; vehicle["rightBrakeLight"] = ((PointLight) tc.Create()); vehicle["leftBrakeLight"] = ((PointLight) tc.Create()); vehicle["inv[BulletAmmo]"] = "1000"; // Mount a ShapeBaseImageData vehicle.mountImage("TurretImage", this["turretSlot"].AsInt(), true, string.Empty); // Mount the brake lights vehicle.mountObject(vehicle["rightBrakeLight"], this["rightBrakeSlot"].AsInt(), new TransformF()); vehicle.mountObject(vehicle["leftbrakelight"], this["leftBrakeSlot"].AsInt(), new TransformF()); }
/// <summary> /// Create a transform from the given translation and orientation. @param position The translation vector for the transform. @param orientation The axis and rotation that orients the transform. @return A transform based on the given position and orientation. @ingroup Matrices ) /// </summary> public TransformF MatrixCreate(Point3F position, AngAxisF orientation){ return new TransformF ( m_ts.fn_MatrixCreate(position.AsString(), orientation.AsString())); }
/// <summary> /// Create an orthogonal basis from the given vector. @param aaf The vector to create the orthogonal basis from. @return A matrix representing the orthogonal basis. @ingroup Vectors ) /// </summary> public MatrixF VectorOrthoBasis(AngAxisF aa){ return new MatrixF ( m_ts.fn_VectorOrthoBasis(aa.AsString())); }
/// <summary> /// Return the integer character code value corresponding to the first character in the given string. /// ) /// /// </summary> public AngAxisF dnt_testcase_2(AngAxisF chr){ return new AngAxisF ( m_ts.fn_dnt_testcase_2(chr.AsString())); }