ValueNode_BLineCalcTangent::ValueNode_BLineCalcTangent(const ValueBase::Type &x):
LinkableValueNode(x)
{
- if(x!=ValueBase::TYPE_ANGLE && x!=ValueBase::TYPE_VECTOR)
+ if(x!=ValueBase::TYPE_ANGLE && x!=ValueBase::TYPE_REAL && x!=ValueBase::TYPE_VECTOR)
throw Exception::BadType(ValueBase::type_local_name(x));
ValueNode_BLine* value_node(new ValueNode_BLine());
switch (get_type())
{
case ValueBase::TYPE_ANGLE: return Angle();
+ case ValueBase::TYPE_REAL: return Real();
case ValueBase::TYPE_VECTOR: return Vector();
default: assert(0); return ValueBase();
}
switch (get_type())
{
case ValueBase::TYPE_ANGLE: return deriv(amount-from_vertex).angle();
+ case ValueBase::TYPE_REAL: return deriv(amount-from_vertex).mag();
case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex);
default: assert(0); return ValueBase();
}
ValueNode_BLineCalcTangent::check_type(ValueBase::Type type)
{
return (type==ValueBase::TYPE_ANGLE ||
+ type==ValueBase::TYPE_REAL ||
type==ValueBase::TYPE_VECTOR);
}