size_t RawVertex::Difference()

in src/raw/RawModel.cpp [42:73]


size_t RawVertex::Difference(const RawVertex& other) const {
  size_t attributes = 0;
  if (position != other.position) {
    attributes |= RAW_VERTEX_ATTRIBUTE_POSITION;
  }
  if (normal != other.normal) {
    attributes |= RAW_VERTEX_ATTRIBUTE_NORMAL;
  }
  if (tangent != other.tangent) {
    attributes |= RAW_VERTEX_ATTRIBUTE_TANGENT;
  }
  if (binormal != other.binormal) {
    attributes |= RAW_VERTEX_ATTRIBUTE_BINORMAL;
  }
  if (color != other.color) {
    attributes |= RAW_VERTEX_ATTRIBUTE_COLOR;
  }
  if (uv0 != other.uv0) {
    attributes |= RAW_VERTEX_ATTRIBUTE_UV0;
  }
  if (uv1 != other.uv1) {
    attributes |= RAW_VERTEX_ATTRIBUTE_UV1;
  }
  // Always need both or neither.
  if (jointIndices != other.jointIndices) {
    attributes |= RAW_VERTEX_ATTRIBUTE_JOINT_INDICES | RAW_VERTEX_ATTRIBUTE_JOINT_WEIGHTS;
  }
  if (jointWeights != other.jointWeights) {
    attributes |= RAW_VERTEX_ATTRIBUTE_JOINT_INDICES | RAW_VERTEX_ATTRIBUTE_JOINT_WEIGHTS;
  }
  return attributes;
}