本文整理汇总了C#中Vec3.MemWrite方法的典型用法代码示例。如果您正苦于以下问题:C# Vec3.MemWrite方法的具体用法?C# Vec3.MemWrite怎么用?C# Vec3.MemWrite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vec3
的用法示例。
在下文中一共展示了Vec3.MemWrite方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JetPackTick
static void JetPackTick() {
if (JetPackCtl) {
float rotz = Mem.ReadFloat(ADDRESSES.DISPLAY.CAMERA_Z_ROT);
var xVal = Math.Abs((float)Math.Cos(rotz)) * (rotz > 0 && rotz < HALF_PI || (rotz > (PI * 2 - HALF_PI) && rotz < PI * 2) ? -1 : 1);
var yVal = Math.Abs((float)Math.Sin(rotz)) * (rotz > PI && rotz < PI * 2 ? 1 : -1);
var coords = new Vec3(Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.COORDS_X_OFFSET));
coords.X += xVal * JetPackSpeed;
coords.Y += yVal * JetPackSpeed;
if ((bool)Config.jetPackCtlEnableZ.Value) {
float rotx = Mem.ReadFloat(ADDRESSES.DISPLAY.CAMERA_X_ROT);
coords.Z += rotx / HALF_PI * JetPackSpeed;
}
coords.MemWrite(Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.COORDS_X_OFFSET));
}
new Vec3(0, 0, 0.0066016f).MemWrite(Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.X_MOVE_SPEED));
if (JetPackUp)
Mem.WriteFloat(ADDRESSES.IsInVehicle ? Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_Z_OFFSET)
: Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.Z_MOVE_SPEED), JetPackSpeed * PI * 2);
else if (JetPackDown)
Mem.WriteFloat(ADDRESSES.IsInVehicle ? Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_Z_OFFSET)
: Mem.PtrToAddr(ADDRESSES.PLAYER.PlayerPointer, ADDRESSES.PLAYER.Z_MOVE_SPEED), -JetPackSpeed * PI * 2);
}
示例2: Bash
public static void Bash()
{
if (!ADDRESSES.IsInVehicle)
return;
var vState = VehicleGetPhysState(ADDRESSES.VEHICLE.VehiclePointer);
var speed = new Vec3(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
var cState = ADDRESSES.DISPLAY.CameraGetState();
Vec3 speedOrig = new Vec3(speed.X, speed.Y, speed.Z);
var nSpeed = speed;
nSpeed.Normalize();
speed = nSpeed * 25;
speed.MemWrite(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
Thread.Sleep(200);
for (int x = 0; x < 3; x++) {
VehicleSetPhysState(ADDRESSES.VEHICLE.VehiclePointer, vState);
speedOrig.MemWrite(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
Thread.Sleep(50);
}
ADDRESSES.DISPLAY.CameraSetState(cState);
}
示例3: SpeedBoost
public static void SpeedBoost()
{
if (!ADDRESSES.IsInVehicle)
return;
Vec3 speed = new Vec3(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
if (Math.Abs(speed.X) < 0.01f && Math.Abs(speed.Y) < 0.01f) {
float dirX = Mem.ReadFloat(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.DIR_X_OFFSET));
float dirY = Mem.ReadFloat(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.DIR_Y_OFFSET));
Mem.WriteFloat(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET), dirX * (float)Config.vehicleSpeedMultiplierSet.Value);
Mem.WriteFloat(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_Y_OFFSET), dirY * (float)Config.vehicleSpeedMultiplierSet.Value);
}
speed *= (float)Config.vehicleSpeedMultiplierSet.Value;
speed.MemWrite(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
}
示例4: InstantStop
// LEFT:
// -1 -1
// 1 -1
// -1 1
public static void InstantStop()
{
Vec3 speed = new Vec3(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
speed *= 0;
speed.MemWrite(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
}
示例5: ForwardTeleport
//Mem.WriteByte(Mem.PtrToAddr(ADDRESES.PLAYER.PlayerPointer, 0x244), 0x01);
public static void ForwardTeleport()
{
if (!ADDRESSES.IsInVehicle)
return;
General.MainForm.SetStatus("Forward teleport (" + DateTime.Now.Ticks + ")");
Vec3 roll = new Vec3(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.ROLL_X_OFFSET));
Vec3 speed = new Vec3(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.SPEED_X_OFFSET));
Vec3 coords = new Vec3(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.COORDS_X_OFFSET));
General.MainForm.SetStatus("X: " + Math.Round(roll.X, 2) + ", Y: " + Math.Round(roll.Y, 2) + ", Z: " + Math.Round(roll.Z, 2) +
"// X: " + Math.Round(speed.X, 2) + ", Y: " + Math.Round(speed.Y, 2) + ", Z: " + Math.Round(speed.Z, 2));
coords.X += -roll.Y * 10;
coords.Y += roll.X * 10;
coords.MemWrite(Mem.PtrToAddr(ADDRESSES.VEHICLE.VehiclePointer, ADDRESSES.VEHICLE.COORDS_X_OFFSET));
}