本文整理汇总了Java中com.panoramagl.PLConstants类的典型用法代码示例。如果您正苦于以下问题:Java PLConstants类的具体用法?Java PLConstants怎么用?Java PLConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PLConstants类属于com.panoramagl包,在下文中一共展示了PLConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeValues
import com.panoramagl.PLConstants; //导入依赖的package包/类
@Override
protected void initializeValues()
{
super.initializeValues();
mVertexs = new float[12];
this.setWidth(PLConstants.kDefaultHotspotSize);
this.setHeight(PLConstants.kDefaultHotspotSize);
mAtv = mAth = 0.0f;
this.setYZAxisInverseRotation(true);
this.setZ(PLConstants.kDefaultHotspotZPosition);
mOnClick = null;
this.setAlpha(PLConstants.kDefaultHotspotAlpha);
this.setDefaultAlpha(PLConstants.kDefaultHotspotAlpha);
mOverAlpha = mDefaultOverAlpha = PLConstants.kDefaultHotspotOverAlpha;
hasChangedCoordProperty = true;
}
示例2: run
import com.panoramagl.PLConstants; //导入依赖的package包/类
/**Runnable methods*/
@Override
public void run()
{
try
{
if(mTokenInfo.getName().equals("load"))
{
PLITokenInfo transitionTokenInfo = (mTokenInfo.hasValue(2) ? mTokenInfo.getTokenInfo(2) : null);
if(transitionTokenInfo != null && transitionTokenInfo.getName().equals("null"))
transitionTokenInfo = null;
mView.load(new PLJSONLoader(mTokenInfo.getString(0)), mTokenInfo.hasValue(1) ? mTokenInfo.getBoolean(1) : false, transitionTokenInfo != null ? new PLTransitionBlend(transitionTokenInfo.getFloat(0), transitionTokenInfo.hasValue(1) ? transitionTokenInfo.getFloat(1) : -1.0f) : null, mTokenInfo.hasValue(3) ? mTokenInfo.getFloat(3) : PLConstants.kFloatUndefinedValue, mTokenInfo.hasValue(4) ? mTokenInfo.getFloat(4) : PLConstants.kFloatUndefinedValue);
}
}
catch(Throwable e)
{
PLLog.error("PLCommandRunnable::run", e);
}
}
示例3: setWidth
import com.panoramagl.PLConstants; //导入依赖的package包/类
@Override
public void setWidth(float width)
{
if(width >= 0.0f && width <= 1.0f && this.getWidth() != width)
{
mWidth = width * PLConstants.kPanoramaRadius * 2.0f;
hasChangedCoordProperty = true;
}
}
示例4: setHeight
import com.panoramagl.PLConstants; //导入依赖的package包/类
@Override
public void setHeight(float height)
{
if(height >= 0.0f && height <= 1.0f && this.getHeight() != height)
{
mHeight = height * PLConstants.kPanoramaRadius * 2.0f;
hasChangedCoordProperty = true;
}
}
示例5: convertPitchAndYawToPosition
import com.panoramagl.PLConstants; //导入依赖的package包/类
/**calculate methods*/
protected PLPosition convertPitchAndYawToPosition(float pitch, float yaw)
{
float r = this.getZ(), pr = (90.0f - pitch) * PLConstants.kToRadians, yr = -yaw * PLConstants.kToRadians;
float x = r * FloatMath.sin(pr) * FloatMath.cos(yr);
float y = r * FloatMath.sin(pr) * FloatMath.sin(yr);
float z = r * FloatMath.cos(pr);
return PLPosition.PLPositionMake(y, z, x);
}
示例6: calculatePoints
import com.panoramagl.PLConstants; //导入依赖的package包/类
protected List<PLPosition> calculatePoints(GL10 gl)
{
List<PLPosition> result = new ArrayList<PLPosition>(4);
//1
PLPosition pos = this.convertPitchAndYawToPosition(mAtv, mAth), pos1 = this.convertPitchAndYawToPosition(mAtv + 0.0001f, mAth);
//2 and 3
PLVector3 p1 = new PLVector3(pos.x, pos.y, pos.z),
p2p1 = new PLVector3(0.0f, 0.0f, 0.0f).sub(p1),
r = p2p1.crossProduct(new PLVector3(pos1.x, pos1.y, pos1.z).sub(p1)),
s = p2p1.crossProduct(r);
//4
r.normalize();
s.normalize();
//5.1
float w = mWidth * PLConstants.kPanoramaRadius, h = mHeight * PLConstants.kPanoramaRadius;
float radius = FloatMath.sqrt((w * w) + (h * h));
//5.2
float angle = (float)Math.asin(h / radius);
//5.3
PLVector3 n = new PLVector3(0.0f, 0.0f, 0.0f);
for(float theta : new float[]{ PLConstants.kPI - angle, angle, PLConstants.kPI + angle, 2 * PLConstants.kPI - angle})
{
n.x = p1.x + (radius * FloatMath.cos(theta) * r.x) + (radius * FloatMath.sin(theta) * s.x);
n.y = p1.y + (radius * FloatMath.cos(theta) * r.y) + (radius * FloatMath.sin(theta) * s.y);
n.z = p1.z + (radius * FloatMath.cos(theta) * r.z) + (radius * FloatMath.sin(theta) * s.z);
n.normalize();
result.add(PLPosition.PLPositionMake(n.x, n.y, n.z));
}
return result;
}
示例7: convertFromSphericalToCartesian
import com.panoramagl.PLConstants; //导入依赖的package包/类
public static void convertFromSphericalToCartesian(float radius, float pitch, float yaw, float picthOffset, float yawOffset, PLPosition result)
{
if(result != null)
{
float pr = (pitch + picthOffset) * PLConstants.kToRadians, yr = (yaw + yawOffset) * PLConstants.kToRadians;
result.setValues((radius * FloatMath.sin(pr) * FloatMath.cos(yr)), (radius * FloatMath.sin(pr) * FloatMath.sin(yr)), (radius * FloatMath.cos(pr)));
}
}
示例8: initializeValues
import com.panoramagl.PLConstants; //导入依赖的package包/类
@Override
protected void initializeValues()
{
mTimer = null;
mInterval = PLConstants.kDefaultTransitionInterval;
mProgressPercentage = 0;
mView = null;
mCurrentPanorama = mNewPanorama = null;
mCurrentPanoramaCamera = mNewPanoramaCamera = null;
mIsPanoramaLocked = mIsRunning = mIsValid = false;
mInternalListener = null;
mListeners = new PLTransitionListenerManager();
}
示例9: initializeValues
import com.panoramagl.PLConstants; //导入依赖的package包/类
@Override
protected void initializeValues()
{
super.initializeValues();
mView = null;
mTransition = null;
mInitialPitch = mInitialYaw = PLConstants.kFloatUndefinedValue;
mJSONData = null;
mURL = null;
mJSON = null;
mIsPreloadingImages = true;
mKeepParameters = null;
mHotspotTextures = new HashMap<String, PLITexture>();
}
示例10: convertPitchAndYawToPosition
import com.panoramagl.PLConstants; //导入依赖的package包/类
/**calculate methods*/
protected PLPosition convertPitchAndYawToPosition(float pitch, float yaw)
{
float r = this.getZ(), pr = (90.0f - pitch) * PLConstants.kToRadians, yr = -yaw * PLConstants.kToRadians;
float x = r * (float)Math.sin(pr) * (float)Math.cos(yr);
float y = r * (float)Math.sin(pr) * (float)Math.sin(yr);
float z = r * (float)Math.cos(pr);
return PLPosition.PLPositionMake(y, z, x);
}
示例11: calculatePoints
import com.panoramagl.PLConstants; //导入依赖的package包/类
protected List<PLPosition> calculatePoints(GL10 gl)
{
List<PLPosition> result = new ArrayList<PLPosition>(4);
//1
PLPosition pos = this.convertPitchAndYawToPosition(mAtv, mAth), pos1 = this.convertPitchAndYawToPosition(mAtv + 0.0001f, mAth);
//2 and 3
PLVector3 p1 = new PLVector3(pos.x, pos.y, pos.z),
p2p1 = new PLVector3(0.0f, 0.0f, 0.0f).sub(p1),
r = p2p1.crossProduct(new PLVector3(pos1.x, pos1.y, pos1.z).sub(p1)),
s = p2p1.crossProduct(r);
//4
r.normalize();
s.normalize();
//5.1
float w = mWidth * PLConstants.kPanoramaRadius, h = mHeight * PLConstants.kPanoramaRadius;
float radius = (float)Math.sqrt((w * w) + (h * h));
//5.2
float angle = (float)Math.asin(h / radius);
//5.3
PLVector3 n = new PLVector3(0.0f, 0.0f, 0.0f);
for(float theta : new float[]{ PLConstants.kPI - angle, angle, PLConstants.kPI + angle, 2 * PLConstants.kPI - angle})
{
n.x = p1.x + (radius * (float)Math.cos(theta) * r.x) + (radius * (float)Math.sin(theta) * s.x);
n.y = p1.y + (radius * (float)Math.cos(theta) * r.y) + (radius * (float)Math.sin(theta) * s.y);
n.z = p1.z + (radius * (float)Math.cos(theta) * r.z) + (radius * (float)Math.sin(theta) * s.z);
n.normalize();
result.add(PLPosition.PLPositionMake(n.x, n.y, n.z));
}
return result;
}
示例12: convertFromSphericalToCartesian
import com.panoramagl.PLConstants; //导入依赖的package包/类
public static void convertFromSphericalToCartesian(float radius, float pitch, float yaw, float picthOffset, float yawOffset, PLPosition result)
{
if(result != null)
{
float pr = (pitch + picthOffset) * PLConstants.kToRadians, yr = (yaw + yawOffset) * PLConstants.kToRadians;
result.setValues((radius * (float)Math.sin(pr) * (float)Math.cos(yr)), (radius * (float)Math.sin(pr) * (float)Math.sin(yr)), (radius * (float)Math.cos(pr)));
}
}
示例13: getWidth
import com.panoramagl.PLConstants; //导入依赖的package包/类
@Override
public float getWidth()
{
return (mWidth / (PLConstants.kPanoramaRadius * 2.0f));
}
示例14: getHeight
import com.panoramagl.PLConstants; //导入依赖的package包/类
@Override
public float getHeight()
{
return (mHeight / (PLConstants.kPanoramaRadius * 2.0f));
}
示例15: iterationsPerSecond
import com.panoramagl.PLConstants; //导入依赖的package包/类
/**control methods*/
protected int iterationsPerSecond()
{
return PLConstants.kDefaultTransitionIterationsPerSecond;
}