⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbmassevent.java

📁 支持任天堂wii2手柄的java中间件
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   BBMassEvent.java

package wiiremotej.event;

import wiiremotej.BalanceBoard;
import wiiremotej.MassConstants;

// Referenced classes of package wiiremotej.event:
//			BBEvent

public class BBMassEvent extends BBEvent
{

	private double mass[][];

	public BBMassEvent(BalanceBoard balanceboard, byte abyte0[])
	{
		super(balanceboard);
		int ai[][] = new int[2][2];
		ai[0][0] = ((abyte0[4] & 0xff) << 8) + (abyte0[5] & 0xff);
		ai[1][0] = ((abyte0[6] & 0xff) << 8) + (abyte0[7] & 0xff);
		ai[0][1] = ((abyte0[8] & 0xff) << 8) + (abyte0[9] & 0xff);
		ai[1][1] = ((abyte0[10] & 0xff) << 8) + (abyte0[11] & 0xff);
		MassConstants massconstants = balanceboard.getMassConstants();
		mass = new double[2][2];
		for (int i = 0; i <= 1; i++)
		{
			for (int j = 0; j <= 1; j++)
			{
				if ((double)ai[j][i] > massconstants.value(j, i, 0) && (double)ai[j][i] <= massconstants.value(j, i, 1))
				{
					mass[j][i] = (((double)ai[j][i] - massconstants.value(j, i, 0)) / (massconstants.value(j, i, 1) - massconstants.value(j, i, 0))) * 17D;
					continue;
				}
				if ((double)ai[j][i] > massconstants.value(j, i, 1))
					mass[j][i] = (((double)ai[j][i] - massconstants.value(j, i, 1)) / (massconstants.value(j, i, 2) - massconstants.value(j, i, 1))) * 17D + 17D;
				else
					mass[j][i] = 0.0D;
			}

		}

	}

	public BBMassEvent(BalanceBoard balanceboard, double d, double d1, double d2, 
			double d3)
	{
		super(balanceboard);
		mass[0][0] = d;
		mass[1][0] = d1;
		mass[0][1] = d2;
		mass[1][1] = d3;
	}

	public double getMass(int i, int j)
		throws IllegalArgumentException
	{
		if (i < 0 || i > 1 || j < 0 || j > 1)
			throw new IllegalArgumentException("Specified row and column are not valid.");
		else
			return mass[i][j];
	}

	public double getTotalMass()
	{
		return mass[0][0] + mass[1][0] + mass[0][1] + mass[1][1];
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -