diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2015-09-24 18:24:20 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2015-09-24 18:24:20 +0300 |
commit | 27b3ea622f8bd313a8e2827dfec752bf2125566c (patch) | |
tree | f212e49d224ce8e1cfc3b17a64ae524711494391 /source/gameengine/Expressions/intern/EmptyValue.cpp | |
parent | 372dff8d1dc7e24d4b2cd37de245588ecfce8bfa (diff) | |
parent | de80e687689032cb85179a1f7e89750573631d5d (diff) |
Merge remote-tracking branch 'origin/master' into cycles_camera_nodescycles_camera_nodes
Note: the branch currently crashes in blender_camera_nodes.cpp:
BL::NodeTree b_ntree = b_data.node_groups[nodes_tree_name];
The crash was introduced in:
cb7cf523e5c000609f32a382e2c0fcc57f635a42
Conflicts:
intern/cycles/SConscript
intern/cycles/blender/addon/__init__.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/blender_camera.cpp
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/svm/svm.h
intern/cycles/kernel/svm/svm_types.h
intern/cycles/render/camera.cpp
intern/cycles/render/camera.h
Diffstat (limited to 'source/gameengine/Expressions/intern/EmptyValue.cpp')
-rw-r--r-- | source/gameengine/Expressions/intern/EmptyValue.cpp | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/source/gameengine/Expressions/intern/EmptyValue.cpp b/source/gameengine/Expressions/intern/EmptyValue.cpp new file mode 100644 index 00000000000..9227626777d --- /dev/null +++ b/source/gameengine/Expressions/intern/EmptyValue.cpp @@ -0,0 +1,133 @@ +/** \file gameengine/Expressions/EmptyValue.cpp + * \ingroup expressions + */ + +// EmptyValue.cpp: implementation of the CEmptyValue class. +/* + * Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org> + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Erwin Coumans makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + */ + +#include "EXP_EmptyValue.h" +#include "EXP_IntValue.h" +#include "EXP_FloatValue.h" +#include "EXP_StringValue.h" +#include "EXP_ErrorValue.h" +#include "EXP_ListValue.h" +#include "EXP_VoidValue.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CEmptyValue::CEmptyValue() +/* + * pre: + * effect: constructs a new CEmptyValue + */ +{ + SetModified(false); +} + + + +CEmptyValue::~CEmptyValue() +/* + * pre: + * effect: deletes the object + */ +{ + +} + + + +CValue *CEmptyValue::Calc(VALUE_OPERATOR op, CValue *val) +/* + * pre: + * ret: a new object containing the result of applying operator op to this + * object and val + */ +{ + return val->CalcFinal(VALUE_EMPTY_TYPE, op, this); + +} + + + +CValue * CEmptyValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val) +/* + * pre: the type of val is dtype + * ret: a new object containing the result of applying operator op to val and + * this object + */ +{ + return val->AddRef(); +} + + + +double CEmptyValue::GetNumber() +{ + return 0; +} + + + +int CEmptyValue::GetValueType() +{ + return VALUE_EMPTY_TYPE; +} + + + +CListValue* CEmptyValue::GetPolySoup() +{ + CListValue* soup = new CListValue(); + //don't add any poly, while it's an empty value + return soup; +} + + + +bool CEmptyValue::IsInside(CValue* testpoint,bool bBorderInclude) +{ + // empty space is solid, so always inside + return true; +} + + + +double* CEmptyValue::GetVector3(bool bGetTransformedVec) +{ + assertd(false); // don't get vector from me + return ZeroVector(); +} + + + +static STR_String emptyString = STR_String(""); + + +const STR_String & CEmptyValue::GetText() +{ + return emptyString; +} + + + +CValue* CEmptyValue::GetReplica() +{ + CEmptyValue* replica = new CEmptyValue(*this); + replica->ProcessReplica(); + return replica; +} + |