public void SetUniformVec4(string name, Point4F value) { if (IsDead()) { throw new Exceptions.SimObjectPointerInvalidException(); } InternalUnsafeMethods.BaseComponentSetUniformVec4(ObjectPtr->ObjPtr, name, value); }
public static Point4F LoadPoint4F(DataStreamPtr reader) { Point4F vect = new Point4F(); vect.w = LoadFloat(reader); vect.x = LoadFloat(reader); vect.y = LoadFloat(reader); vect.z = LoadFloat(reader); return(vect); }
internal static void Vec4NodeSetValue(IntPtr vec4Node, Point4F val) { if (_Vec4NodeSetValueFunc == null) { _Vec4NodeSetValueFunc = (_Vec4NodeSetValue)Marshal.GetDelegateForFunctionPointer(Interop.Torque6.DllLoadUtils.GetProcAddress(Interop.Torque6.Torque6LibHandle, "Vec4NodeSetValue"), typeof(_Vec4NodeSetValue)); } _Vec4NodeSetValueFunc(vec4Node, val); }
internal static void BaseComponentSetUniformVec4(IntPtr baseComponent, string name, Point4F value) { if (_BaseComponentSetUniformVec4Func == null) { _BaseComponentSetUniformVec4Func = (_BaseComponentSetUniformVec4)Marshal.GetDelegateForFunctionPointer(Interop.Torque6.DllLoadUtils.GetProcAddress(Interop.Torque6.Torque6LibHandle, "BaseComponentSetUniformVec4"), typeof(_BaseComponentSetUniformVec4)); } _BaseComponentSetUniformVec4Func(baseComponent, name, value); }
public static Quaternion ToQuaternion(this Point4F point4f) { return(new Quaternion(point4f.w, point4f.x, point4f.y, point4f.z)); }
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()); }