Example #1
0
bool SVSScene::update_object(std::string name, Zeni::Point3f position, Zeni::Quaternion rotation, Zeni::Point3f scale)
{
	SVSObject* object = get_object_by_name(name);

	if (object == NULL)
		return false;

	Zeni::Matrix4f transformation = Zeni::Matrix4f::Translate(position) * Zeni::Matrix4f::Rotate(rotation) * Zeni::Matrix4f::Scale(scale);

	object->transform(transformation, position, rotation, scale);

	return true;
}
Example #2
0
static PyObject *
get_extension (certificate_x509 *self, PyObject *args, PyObject *keywords)
{
	const char *oid = NULL;
	const char *name = NULL;

	static char *keywordlist[] = { "oid", "name", NULL };

	if (!PyArg_ParseTupleAndKeywords (args, keywords, "|ss", keywordlist,
					  &oid, &name)) {
		return NULL;
	}

	char *value = NULL;
	size_t length;
	ASN1_OBJECT *obj = NULL;
	if (name != NULL) {
		obj = get_object_by_name (name);
	} else {
		obj = get_object_by_oid (oid);
	}

	if (obj == NULL) {
		Py_INCREF (Py_None);
		return Py_None;
	}

	length = get_extension_by_object (self->x509, obj, &value);
	ASN1_OBJECT_free (obj);
	if (value != NULL) {
		PyObject *extension = PyString_FromStringAndSize (value,
								  length);
		free (value);
		return extension;
	} else {
		Py_INCREF (Py_None);
		return Py_None;
	}
}