本文整理汇总了C#中WinterLeaf.Containers.Point3F类的典型用法代码示例。如果您正苦于以下问题:C# Point3F类的具体用法?C# Point3F怎么用?C# Point3F使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point3F类属于WinterLeaf.Containers命名空间,在下文中一共展示了Point3F类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectileDataOnCollision
public void ProjectileDataOnCollision(coProjectileData datablock, coProjectile projectile, coShapeBase shapebase, string fad, Point3F pos, string normal)
{
// Apply damage to the object all shape base objects
if (datablock["directDamage"].AsFloat() > 0)
if ((console.getTypeMask(shapebase) & (uint) SceneObjectTypesAsUint.ShapeBaseObjectType) == (uint) SceneObjectTypesAsUint.ShapeBaseObjectType)
ShapeBaseDamage(shapebase,projectile.ID, pos, datablock["directDamage"].AsFloat(), datablock["damageType"]);
}
示例2: Box3F
public Box3F(string box)
{
string[] parts = box.Split(' ');
if (parts.GetUpperBound(0) < 5)
return;
minExtents = new Point3F(parts[0].AsFloat(), parts[1].AsFloat(), parts[2].AsFloat());
maxExtents = new Point3F(parts[3].AsFloat(), parts[4].AsFloat(), parts[5].AsFloat());
}
示例3: ProjectileDataOnExplode
public void ProjectileDataOnExplode(coProjectileData data, coProjectile proj, Point3F position, string mod)
{
// Damage objects within the projectiles damage radius
float radius = data["damageRadius"].AsFloat();
if (radius <= 0)
return;
string damageType = data["damageType"];
float areaImpulse = data["areaImpulse"].AsFloat();
float radiusDamage = data["radiusDamage"].AsFloat();
RadiusDamage((coPlayer) proj.ID, position, radius, radiusDamage, damageType, areaImpulse);
}
示例4: RadiusDamage
public void RadiusDamage(coShapeBase sourceobject, Point3F position, float radius, float damage, string damageType, float impulse)
{
// Use the container system to iterate through all the objects
// within our explosion radius. We'll apply damage to all ShapeBase
// objects.
Dictionary<uint, float> r = console.initContainerRadiusSearch(new Point3F(position), radius, (uint) SceneObjectTypesAsUint.ShapeBaseObjectType);
float halfRadius = radius/(float) 2.0;
foreach (coPlayer targetObject in r.Keys)
{
// Calculate how much exposure the current object has to
// the explosive force. The object types listed are objects
// that will block an explosion. If the object is totally blocked,
// then no damage is applied.
UInt32 mask = (uint) SceneObjectTypesAsUint.InteriorObjectType | (uint) SceneObjectTypesAsUint.TerrainObjectType | (uint) SceneObjectTypesAsUint.StaticShapeObjectType | (uint) SceneObjectTypesAsUint.VehicleObjectType;
float coverage = Util.calcExplosionCoverage(new Point3F(position), targetObject, mask);
if (!coverage.AsBool())
continue;
float dist = r[targetObject];
// Calculate a distance scale for the damage and the impulse.
// Full damage is applied to anything less than half the radius away,
// linear scale from there.
float distScale = (float) ((dist < halfRadius) ? 1.0 : 1 - ((dist - halfRadius)/halfRadius));
// Apply the damage
ShapeBaseDamage(targetObject, sourceobject, position, (((damage)*coverage*distScale)), damageType);
// Apply the impulse
if (!impulse.AsBool())
continue;
TransformF impulseVec = new TransformF(targetObject.getWorldBoxCenter()) - new TransformF(position);
impulseVec = impulseVec.normalizeSafe();
impulseVec = impulseVec.vectorScale(impulse*distScale);
targetObject.applyImpulse(new Point3F(position), impulseVec.MPosition);
}
}
示例5: setOrbitMode
/// <summary>
/// Set the camera to orbit around the given object, or if none is given, around the given point.
/// @param orbitObject The object to orbit around. If no object is given (0 or blank string is passed in) use the orbitPoint instead
/// @param orbitPoint The point to orbit around when no object is given. In the form of \"x y z ax ay az aa\" such as returned by SceneObject::getTransform().
/// @param minDistance The minimum distance allowed to the orbit object or point.
/// @param maxDistance The maximum distance allowed from the orbit object or point.
/// @param initDistance The initial distance from the orbit object or point.
/// @param ownClientObj [optional] Are we orbiting an object that is owned by us? Default is false.
/// @param offset [optional] An offset added to the camera's position. Default is no offset.
/// @param locked [optional] Indicates the camera does not receive input from the player. Default is false.
/// @see Camera::setOrbitObject()
/// @see Camera::setOrbitPoint())
///
/// </summary>
public void setOrbitMode(string camera, string orbitObject, TransformF orbitPoint, float minDistance, float maxDistance, float initDistance, bool ownClientObj, Point3F offset, bool xlocked){
m_ts.fnCamera_setOrbitMode(camera, orbitObject, orbitPoint.AsString(), minDistance, maxDistance, initDistance, ownClientObj, offset.AsString(), xlocked);
}
示例6: ShapeBaseDamage
public void ShapeBaseDamage(coShapeBase shapebase, coShapeBase sourceobject, Point3F position, float damage, string damagetype)
{
// All damage applied by one object to another should go through this method.
// This function is provided to allow objects some chance of overriding or
// processing damage values and types. As opposed to having weapons call
// ShapeBase::applyDamage directly. Damage is redirected to the datablock,
// this is standard procedure for many built in callbacks.
if (shapebase.isObject())
{
coShapeBaseData datablock = shapebase.getDataBlock();
datablock.call("damage", shapebase, position.AsString(), sourceobject, damage.AsString(), damagetype);
}
}
示例7: ProximityMineDataOnExplode
public void ProximityMineDataOnExplode(coProximityMineData datablock, coProximityMine shapebase, Point3F position)
{
// Damage objects within the mine's damage radius
if (datablock["damageRadius"].AsFloat() > 0)
RadiusDamage(shapebase, position, datablock["damageRadius"].AsFloat(), datablock["radiusDamage"].AsFloat(), datablock["damageType"], datablock["areaImpulse"].AsFloat());
}
示例8: setOffset
/// <summary>
/// Set the camera's offset.
/// The offset is added to the camera's position when set to CameraMode::OrbitObject.
/// @param offset The distance to offset the camera by in the form of \"x y z\".)
///
/// </summary>
public void setOffset(string camera, Point3F offset){
m_ts.fnCamera_setOffset(camera, offset.AsString());
}
示例9: setOrbitPoint
/// <summary>
/// Set the camera to orbit around a given point.
/// @param orbitPoint The point to orbit around. In the form of \"x y z ax ay az aa\" such as returned by SceneObject::getTransform().
/// @param minDistance The minimum distance allowed to the orbit object or point.
/// @param maxDistance The maximum distance allowed from the orbit object or point.
/// @param initDistance The initial distance from the orbit object or point.
/// @param offset [optional] An offset added to the camera's position. Default is no offset.
/// @param locked [optional] Indicates the camera does not receive input from the player. Default is false.
/// @see Camera::setOrbitMode())
///
/// </summary>
public void setOrbitPoint(string camera, TransformF orbitPoint, float minDistance, float maxDistance, float initDistance, Point3F offset, bool xlocked){
m_ts.fnCamera_setOrbitPoint(camera, orbitPoint.AsString(), minDistance, maxDistance, initDistance, offset.AsString(), xlocked);
}
示例10: AngAxisF
/// <summary>
/// Constructor From String
/// </summary>
/// <param name="angaxisf"></param>
public AngAxisF(string angaxisf)
{
string[] fl = angaxisf.Split(' ');
_mAxis = new Point3F(0, 0, 0);
_mAxis.OnChangeNotification += _mAxis_OnChangeNotification;
_mAxis.x = fl[0].AsFloat();
_mAxis.y = fl[1].AsFloat();
_mAxis.z = fl[2].AsFloat();
_mAngle = fl[3].AsFloat();
}
示例11: renderCircle
/// <summary>
/// )
///
/// </summary>
public void renderCircle(string edittsctrl, Point3F pos, Point3F normal, float radius, int segments){
m_ts.fnEditTSCtrl_renderCircle(edittsctrl, pos.AsString(), normal.AsString(), radius, segments);
}
示例12: renderLine
/// <summary>
/// )
///
/// </summary>
public void renderLine(string edittsctrl, Point3F start, Point3F end, float lineWidth){
m_ts.fnEditTSCtrl_renderLine(edittsctrl, start.AsString(), end.AsString(), lineWidth);
}
示例13: drawLine
/// <summary>
/// Draws a line primitive between two 3d points. )
///
/// </summary>
public void drawLine(string debugdrawer, Point3F a, Point3F b, ColorF color){
m_ts.fnDebugDrawer_drawLine(debugdrawer, a.AsString(), b.AsString(), color.AsString());
}
示例14: renderBox
/// <summary>
/// )
///
/// </summary>
public void renderBox(string edittsctrl, Point3F pos, Point3F size){
m_ts.fnEditTSCtrl_renderBox(edittsctrl, pos.AsString(), size.AsString());
}
示例15: setVelocity
/// <summary>
/// Set the velocity for the camera.
/// @param velocity The camera's velocity in the form of \"x y z\".
/// @note Only affects the Camera when in Newton mode.)
///
/// </summary>
public void setVelocity(string camera, Point3F velocity){
m_ts.fnCamera_setVelocity(camera, velocity.AsString());
}