/// <description> /// ( pRotation ) /// </description> public void SetNodeRotation(AngAxisF aa = null) { aa = aa ?? new AngAxisF("0 0 0 0"); aa.Alloc(); InternalUnsafeMethods.SetNodeRotation__Args _args = new InternalUnsafeMethods.SetNodeRotation__Args() { aa = aa.internalStructPtr, }; InternalUnsafeMethods.SetNodeRotation()(ObjectPtr, _args); aa.Free(); }
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()); }
public TransformF(Point3F pos, AngAxisF orientation, bool hasRotation = true) { Position = pos; Orientation = orientation; HasRotation = hasRotation; }